1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2019-07-14 21:35:59 -07:00
parent 01229ec651
commit da45981491

View File

@ -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")
}