Encode: fix ignored indent of array tables (#889)

Fixes #888
This commit is contained in:
Thomas Pelletier
2023-08-28 09:52:11 -04:00
committed by GitHub
parent bb026cae89
commit 4040373cfd
2 changed files with 42 additions and 0 deletions
+4
View File
@@ -983,6 +983,10 @@ func (enc *Encoder) encodeSliceAsArrayTable(b []byte, ctx encoderCtx, v reflect.
scratch = append(scratch, "]]\n"...)
ctx.skipTableHeader = true
if enc.indentTables {
ctx.indent++
}
b = enc.encodeComment(ctx.indent, ctx.options.comment, b)
for i := 0; i < v.Len(); i++ {