sqlh
https://github.com/nofeaturesonlybugs/sqlh
Powerful struct scanning for Go's database/sql and other compatible interfaces.
sqlhis easy to use because it lives very close todatabase/sql. The primary goal ofsqlhis to work with and facilitate usingdatabase/sqlwithout replacing or hijacking it. When usingsqlhyou manage your*sql.DBor create*sql.Txas you normally would and pass those as arguments to functions insqlhwhen scanning or persisting models;sqlhthen works within the confines of what you gave it.
When accepting arguments that work directly with the database (
*sql.DBor*sql.Tx)sqlhaccepts them as interfaces. This meanssqlhmay work with other database packages that define their own types as long as they kept a method set similar todatabase/sql.