From 7d83cfcea1a96ffc55ad6bc7bd25ff2f72994000 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Tue, 9 Feb 2021 09:25:33 +0900 Subject: [PATCH] Fix error by linter --- encode_compile.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/encode_compile.go b/encode_compile.go index 5f07b32..3cc1ff3 100644 --- a/encode_compile.go +++ b/encode_compile.go @@ -1116,7 +1116,7 @@ func encodeAnonymousStructFieldPairMap(tags structTags, named string, valueCode isTaggedKey: f.isTaggedKey, }) 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...) } } @@ -1129,7 +1129,7 @@ func encodeAnonymousStructFieldPairMap(tags structTags, named string, valueCode 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{} f := valueCode var prevAnonymousField *opcode @@ -1142,7 +1142,7 @@ func encodeAnonymousFieldPairRecursively(tags structTags, named string, valueCod isTaggedKey: f.isTaggedKey, }) 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...) } }