mirror of https://github.com/goccy/go-json.git
newline
This commit is contained in:
parent
76a5d06ee7
commit
260c426a4c
|
@ -84,7 +84,9 @@ func (e *Encoder) encodeWithOption(ctx *encoder.RuntimeContext, v interface{}, o
|
||||||
} else {
|
} else {
|
||||||
buf = buf[:len(buf)-1]
|
buf = buf[:len(buf)-1]
|
||||||
}
|
}
|
||||||
buf = append(buf, '\n')
|
if !ctx.Option.DisableNewline {
|
||||||
|
buf = append(buf, '\n')
|
||||||
|
}
|
||||||
if _, err := e.w.Write(buf); err != nil {
|
if _, err := e.w.Write(buf); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue