Skip to content

Commit

Permalink
Merge pull request denisenkom#547 from Mungrel/surface-value-error
Browse files Browse the repository at this point in the history
Handle error returned from a.Value()
  • Loading branch information
jmoiron authored Aug 26, 2019
2 parents 38398a3 + 963a1e7 commit d7d9517
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ func In(query string, args ...interface{}) (string, []interface{}, error) {

for i, arg := range args {
if a, ok := arg.(driver.Valuer); ok {
arg, _ = a.Value()
var err error
arg, err = a.Value()
if err != nil {
return "", nil, err
}
}
v := reflect.ValueOf(arg)
t := reflectx.Deref(v.Type())
Expand Down

0 comments on commit d7d9517

Please sign in to comment.