|
|
@ -322,12 +322,13 @@ func (u *Unmarshaler) processNamedField(field reflect.StructField, value reflect
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
k := key
|
|
|
|
|
|
|
|
|
|
|
|
fullName = join(fullName, key)
|
|
|
|
|
|
|
|
canonicalKey := key
|
|
|
|
if u.opts.canonicalKey != nil {
|
|
|
|
if u.opts.canonicalKey != nil {
|
|
|
|
k = u.opts.canonicalKey(key)
|
|
|
|
canonicalKey = u.opts.canonicalKey(key)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fullName = join(fullName, key)
|
|
|
|
mapValue, hasValue := getValue(m, canonicalKey)
|
|
|
|
mapValue, hasValue := getValue(m, k)
|
|
|
|
|
|
|
|
if hasValue {
|
|
|
|
if hasValue {
|
|
|
|
return u.processNamedFieldWithValue(field, value, mapValue, key, opts, fullName)
|
|
|
|
return u.processNamedFieldWithValue(field, value, mapValue, key, opts, fullName)
|
|
|
|
}
|
|
|
|
}
|
|
|
|