Fix incorrect indent

This commit is contained in:
peterlimg 2021-07-22 17:22:07 +10:00
parent a95c5abe6c
commit ad245e5323
No known key found for this signature in database
GPG Key ID: 4F031F0B25AD570C
1 changed files with 2 additions and 4 deletions

View File

@ -1417,7 +1417,7 @@ func compileStruct(ctx *compileContext, isPtr bool) (*Opcode, error) {
valueCode = code
}
if field.Anonymous {
if field.Anonymous && !tag.IsTaggedKey {
tagKey := ""
if tag.IsTaggedKey {
tagKey = tag.Key
@ -1426,9 +1426,7 @@ func compileStruct(ctx *compileContext, isPtr bool) (*Opcode, error) {
anonymousFields[k] = append(anonymousFields[k], v...)
}
if !tag.IsTaggedKey {
valueCode.decIndent()
}
valueCode.decIndent()
// fix issue144
if !(isPtr && strings.Contains(valueCode.Op.String(), "Marshal")) {