mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-23 14:19:38 +07:00
feat: config.Marshaller allows negative depth
This commit is contained in:
@ -45,6 +45,9 @@ func (m *Marshaller) Bytes() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Marshaller) writeLine(depth int, line string) {
|
func (m *Marshaller) writeLine(depth int, line string) {
|
||||||
|
if depth < 0 {
|
||||||
|
depth = 0
|
||||||
|
}
|
||||||
m.buf.Write(bytes.Repeat([]byte{' '}, depth*m.IndentSpace))
|
m.buf.Write(bytes.Repeat([]byte{' '}, depth*m.IndentSpace))
|
||||||
m.buf.WriteString(line)
|
m.buf.WriteString(line)
|
||||||
m.buf.WriteString("\n")
|
m.buf.WriteString("\n")
|
||||||
|
Reference in New Issue
Block a user