Fix error by linter

This commit is contained in:
Masaaki Goshima 2021-02-09 09:25:33 +09:00
parent d2de9a1eb5
commit 7d83cfcea1
1 changed files with 3 additions and 3 deletions

View File

@ -1116,7 +1116,7 @@ func encodeAnonymousStructFieldPairMap(tags structTags, named string, valueCode
isTaggedKey: f.isTaggedKey, isTaggedKey: f.isTaggedKey,
}) })
if f.next != nil && f.nextField != f.next && f.next.op.codeType() == codeStructField { if f.next != nil && f.nextField != f.next && f.next.op.codeType() == codeStructField {
for k, v := range encodeAnonymousFieldPairRecursively(tags, named, f.next) { for k, v := range encodeAnonymousFieldPairRecursively(named, f.next) {
anonymousFields[k] = append(anonymousFields[k], v...) anonymousFields[k] = append(anonymousFields[k], v...)
} }
} }
@ -1129,7 +1129,7 @@ func encodeAnonymousStructFieldPairMap(tags structTags, named string, valueCode
return anonymousFields return anonymousFields
} }
func encodeAnonymousFieldPairRecursively(tags structTags, named string, valueCode *opcode) map[string][]structFieldPair { func encodeAnonymousFieldPairRecursively(named string, valueCode *opcode) map[string][]structFieldPair {
anonymousFields := map[string][]structFieldPair{} anonymousFields := map[string][]structFieldPair{}
f := valueCode f := valueCode
var prevAnonymousField *opcode var prevAnonymousField *opcode
@ -1142,7 +1142,7 @@ func encodeAnonymousFieldPairRecursively(tags structTags, named string, valueCod
isTaggedKey: f.isTaggedKey, isTaggedKey: f.isTaggedKey,
}) })
if f.next != nil && f.nextField != f.next && f.next.op.codeType() == codeStructField { if f.next != nil && f.nextField != f.next && f.next.op.codeType() == codeStructField {
for k, v := range encodeAnonymousFieldPairRecursively(tags, named, f.next) { for k, v := range encodeAnonymousFieldPairRecursively(named, f.next) {
anonymousFields[k] = append(anonymousFields[k], v...) anonymousFields[k] = append(anonymousFields[k], v...)
} }
} }