mirror of
https://github.com/labstack/echo.git
synced 2024-11-24 08:22:21 +02:00
parent
01229ec651
commit
da45981491
7
bind.go
7
bind.go
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user