fix: fillDefault, handling of nested structs (#3072)

This commit is contained in:
MarkJoyMa
2023-04-08 19:43:13 +08:00
committed by GitHub
parent 07f03ebd0c
commit 2e6402f4b5
2 changed files with 33 additions and 3 deletions

View File

@@ -818,6 +818,11 @@ func (u *Unmarshaler) processNamedFieldWithoutValue(fieldType reflect.Type, valu
}
if u.opts.fillDefault {
if fieldType.Kind() != reflect.Ptr && fieldKind == reflect.Struct {
return u.processFieldNotFromString(fieldType, value, valueWithParent{
value: emptyMap,
}, opts, fullName)
}
return nil
}