You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maybeExpandNamedQuery() now checks time.Time & driver.Valuer types
first before trying to check if the passed param is a map of named
params.
It allows to pass a map[string]struct{}{} type implementing
driver.Valuer without suffering any conflict with a map of named
params.
Closesgo-gorp#423
maxatome
added a commit
to maxatome/gorp
that referenced
this issue
Sep 21, 2020
maybeExpandNamedQuery() now checks time.Time & driver.Valuer types
first before trying to check if the passed param is a map of named
params.
It allows to pass a map[string]struct{}{} type implementing
driver.Valuer without suffering any conflict with a map of named
params.
Closesgo-gorp#423
Hi,
In
maybeExpandNamedQuery
thedriver.Valuer
interface is tested too late IMHO. It should be the first thing to test in this function.If I have a
map[string]x
parameter that implementsdriver.Valuer
interface, it is caught by https://github.com/go-gorp/gorp/blob/master/gorp.go#L216 test...My use case is to have a set
map[string]struct{}
with aValue
method that changes it to a SQL array of strings.I can submit a PR, if you agree.
The text was updated successfully, but these errors were encountered: