Skip to content

Commit

Permalink
do not duplicate bindAnyArgs in bindArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoiron committed Jan 24, 2021
1 parent 68949f7 commit ba0e7e7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions named.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ func bindAnyArgs(names []string, arg interface{}, m *reflectx.Mapper) ([]interfa
// type, given a list of names to pull out of the struct. Used by public
// BindStruct interface.
func bindArgs(names []string, arg interface{}, m *reflectx.Mapper) ([]interface{}, error) {
if maparg, ok := arg.(map[string]interface{}); ok {
return bindMapArgs(names, maparg)
}

arglist := make([]interface{}, 0, len(names))

// grab the indirected value of arg
Expand Down Expand Up @@ -206,7 +202,7 @@ func bindStruct(bindType int, query string, arg interface{}, m *reflectx.Mapper)
return "", []interface{}{}, err
}

arglist, err := bindArgs(names, arg, m)
arglist, err := bindAnyArgs(names, arg, m)
if err != nil {
return "", []interface{}{}, err
}
Expand Down

0 comments on commit ba0e7e7

Please sign in to comment.