mirror of
https://github.com/labstack/echo.git
synced 2025-11-27 22:38:25 +02:00
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()
|
typ := reflect.TypeOf(ptr).Elem()
|
||||||
val := reflect.ValueOf(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 {
|
if typ.Kind() != reflect.Struct {
|
||||||
return errors.New("binding element must be a struct")
|
return errors.New("binding element must be a struct")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user