1
0
mirror of https://github.com/json-iterator/go.git synced 2025-07-15 23:54:21 +02:00

#75 support MarshalIndent

This commit is contained in:
Tao Wen
2017-06-29 20:48:27 +08:00
parent 1253b8edd3
commit 678c297af3
4 changed files with 32 additions and 7 deletions

View File

@ -225,7 +225,11 @@ func (stream *Stream) WriteObjectStart() {
func (stream *Stream) WriteObjectField(field string) {
stream.WriteString(field)
stream.writeByte(':')
if stream.indention > 0 {
stream.writeTwoBytes(':', ' ')
} else {
stream.writeByte(':')
}
}
func (stream *Stream) WriteObjectEnd() {