Add a newline before the final ] when pretty-printing lists and maps.

This commit is contained in:
Qi Xiao 2016-02-25 00:35:47 +01:00
parent bb1078d002
commit 35f5798bcd

View File

@ -118,6 +118,9 @@ func (b *ListReprBuilder) String() string {
if b.buf.Len() == 0 {
return "[]"
}
if b.Indent >= 0 {
b.buf.WriteString("\n" + strings.Repeat(" ", b.Indent))
}
b.buf.WriteByte(']')
return b.buf.String()
}