Skip to content

Commit

Permalink
Fix indent issue for embed struct with tag
Browse files Browse the repository at this point in the history
  • Loading branch information
peterlimg committed Jul 22, 2021
1 parent ac9a7dd commit a95c5ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/encoder/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,10 @@ func compileStruct(ctx *compileContext, isPtr bool) (*Opcode, error) {
for k, v := range anonymousStructFieldPairMap(tags, tagKey, valueCode) {
anonymousFields[k] = append(anonymousFields[k], v...)
}
valueCode.decIndent()

if !tag.IsTaggedKey {
valueCode.decIndent()
}

// fix issue144
if !(isPtr && strings.Contains(valueCode.Op.String(), "Marshal")) {
Expand Down

0 comments on commit a95c5ab

Please sign in to comment.