Fix indent issue for embed struct with tag

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

View File

@ -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...)
}
if !tag.IsTaggedKey {
valueCode.decIndent()
}
// fix issue144
if !(isPtr && strings.Contains(valueCode.Op.String(), "Marshal")) {