#206·sqlx

Colon in string with a space after it can lead to invalid param name

Author: MaerF0x0Created Feb 18, 2016Updated Jul 21, 2026
sql
SELECT '1: profiles' as p FROM profiles

Will result in an empty string name being inserted into the param name list.

This line should only run if we find a non-empty name: https://github.com/jmoiron/sqlx/blob/master/named.go#L264-L265

We're seeing errors:

go
"could not find name  in map[string]interface {}(nil)"

note the dbl space between "name" and "in" , its substituting an empty string in %s.

LMK if you'll take a PR for fixing.