Why? It is Postgresql that sets the rules and $1,$2 etc is the common way to pass parameters. Not only in Go. But you can Scan into a struct. But as I avoid structs for DRY reasons, I cannot guide you…
Your code example isn’t complete so it’s hard to tell. Have you tried adding DB tags to the struct? From the docs:
// Named queries can also use structs. Their bind names follow the same rules
// as the name → db mapping, so struct fields are lowercased and the db tag
// is taken into consideration.
Also that property jsonin isn’t declared anywhere in your code. Where is that coming from? Finally, I’m not familiar with sqlx but are you sure you shouldn’t be using global.Db.NamedQuery based on that comment from the docs I just referenced?