fix: mapping FillDefault is optional! bug (#3940)

This commit is contained in:
MarkJoyMa
2024-02-28 00:23:47 +08:00
committed by GitHub
parent 1f63cbe9c6
commit 88aab8f635
2 changed files with 15 additions and 0 deletions

View File

@@ -428,6 +428,10 @@ func (u *Unmarshaler) parseOptionsWithContext(field reflect.StructField, m Value
}
}
if u.opts.fillDefault {
return key, &options.fieldOptionsWithContext, nil
}
optsWithContext, err := options.toOptionsWithContext(key, m, fullName)
if err != nil {
return "", nil, err