mirror of https://github.com/goccy/go-json.git
Refactor
This commit is contained in:
parent
0d57bf1014
commit
d2de9a1eb5
|
@ -1134,16 +1134,7 @@ func encodeAnonymousFieldPairRecursively(tags structTags, named string, valueCod
|
|||
f := valueCode
|
||||
var prevAnonymousField *opcode
|
||||
for {
|
||||
if f.displayKey == "" {
|
||||
if f.nextField == nil {
|
||||
break
|
||||
}
|
||||
prevAnonymousField = f
|
||||
f = f.nextField
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.Contains(f.op.String(), "Anonymous") {
|
||||
if f.displayKey != "" && strings.Contains(f.op.String(), "Anonymous") {
|
||||
key := fmt.Sprintf("%s.%s", named, f.displayKey)
|
||||
anonymousFields[key] = append(anonymousFields[key], structFieldPair{
|
||||
prevField: prevAnonymousField,
|
||||
|
|
Loading…
Reference in New Issue