Skip to content

Commit ab209a7

Browse files
committed
Minor cleanup
1 parent 90352ac commit ab209a7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

jsontext/encode.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -724,13 +724,9 @@ func (e *encoderState) reformatObject(dst []byte, src Value, depth int) ([]byte,
724724
if src[n] != ':' {
725725
return dst, n, newInvalidCharacterError(src[n:], "after object name (expecting ':')")
726726
}
727-
if e.Flags.Get(jsonflags.SpaceAfterColon) {
728-
dst = append(dst, ':', ' ')
729-
} else {
730-
dst = append(dst, ':')
731-
}
727+
dst = append(dst, ':')
732728
n += len(":")
733-
if e.Flags.Get(jsonflags.Multiline) {
729+
if e.Flags.Get(jsonflags.Multiline | jsonflags.SpaceAfterColon) {
734730
dst = append(dst, ' ')
735731
}
736732

0 commit comments

Comments
 (0)