diff --git a/reflect/convert.go b/reflect/convert.go index 3e43fb1..3be00c6 100644 --- a/reflect/convert.go +++ b/reflect/convert.go @@ -47,7 +47,7 @@ func ConvertToType(v interface{}, t reflect.Type) (interface{}, error) { switch t.Kind() { case Map: var ( - res = reflect.MakeMap(t) + res = reflect.MakeMapWithSize(t, len(vv.MapKeys())) ck interface{} ) for _, k := range vv.MapKeys() {