feat: config.Marshaller allows negative depth

This commit is contained in:
mzz2017 2023-03-11 11:09:49 +08:00
parent b88fef890d
commit 2edbdae72f

View File

@ -45,6 +45,9 @@ func (m *Marshaller) Bytes() []byte {
}
func (m *Marshaller) writeLine(depth int, line string) {
if depth < 0 {
depth = 0
}
m.buf.Write(bytes.Repeat([]byte{' '}, depth*m.IndentSpace))
m.buf.WriteString(line)
m.buf.WriteString("\n")