decode: fix wrong indention for tables' comments (#892)

This commit is contained in:
Mikhail f. Shiryaev
2023-08-28 19:23:11 +02:00
committed by GitHub
parent 76cc96f6d8
commit 4a5c27c299
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -983,12 +983,12 @@ func (enc *Encoder) encodeSliceAsArrayTable(b []byte, ctx encoderCtx, v reflect.
scratch = append(scratch, "]]\n"...)
ctx.skipTableHeader = true
b = enc.encodeComment(ctx.indent, ctx.options.comment, b)
if enc.indentTables {
ctx.indent++
}
b = enc.encodeComment(ctx.indent, ctx.options.comment, b)
for i := 0; i < v.Len(); i++ {
if i != 0 {
b = append(b, "\n"...)