jmoiron / sqlx

general purpose extensions to golang's database/sql
http://jmoiron.github.io/sqlx/
MIT License
16.3k stars 1.09k forks source link

Improve error messaging for empty named parameter keys #920

Open leefernandes opened 8 months ago

leefernandes commented 8 months ago

This PR is to improve the error message returned by sqlx when a named bind parameter name is empty. Example: SELECT * FROM person WHERE id=:id -- TODO: Improve stuff

Instead of could not find name in struct{ID:1} the output is sqlx.bindArgs: empty named parameter at index 1 in []string{"id", ""}