+3
-3
@@ -412,9 +412,10 @@ func (d *decoder) handleKeyPart(key ast.Iterator, v reflect.Value, nextFn handle
|
||||
elem = v.Elem()
|
||||
return d.handleKeyPart(key, elem, nextFn, makeFn)
|
||||
case reflect.Map:
|
||||
vt := v.Type()
|
||||
|
||||
// Create the key for the map element. For now assume it's a string.
|
||||
mk := reflect.ValueOf(string(key.Node().Data))
|
||||
// Create the key for the map element. Convert to key type.
|
||||
mk := reflect.ValueOf(string(key.Node().Data)).Convert(vt.Key())
|
||||
|
||||
// If the map does not exist, create it.
|
||||
if v.IsNil() {
|
||||
@@ -431,7 +432,6 @@ func (d *decoder) handleKeyPart(key ast.Iterator, v reflect.Value, nextFn handle
|
||||
// map[string]interface{} or a []interface{} depending on whether
|
||||
// this is the last part of the array table key.
|
||||
|
||||
vt := v.Type()
|
||||
t := vt.Elem()
|
||||
if t.Kind() == reflect.Interface {
|
||||
mv = makeFn()
|
||||
|
||||
Reference in New Issue
Block a user