Skip to content

Commit

Permalink
Fixed #988
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <vr@labstack.com>
  • Loading branch information
vishr committed Jul 15, 2019
1 parent 01229ec commit da45981
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ func (b *DefaultBinder) bindData(ptr interface{}, data map[string][]string, tag
typ := reflect.TypeOf(ptr).Elem()
val := reflect.ValueOf(ptr).Elem()

if m, ok := ptr.(*map[string]interface{}); ok {
for k, v := range data {
(*m)[k] = v[0]
}
return nil
}

if typ.Kind() != reflect.Struct {
return errors.New("binding element must be a struct")
}
Expand Down

0 comments on commit da45981

Please sign in to comment.