mirror of https://github.com/goccy/go-json.git
Merge 3918cb256f
into 3e9769d637
This commit is contained in:
commit
9d7582fa11
|
@ -84,7 +84,9 @@ func (e *Encoder) encodeWithOption(ctx *encoder.RuntimeContext, v interface{}, o
|
|||
} else {
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ type Option struct {
|
|||
Context context.Context
|
||||
DebugOut io.Writer
|
||||
DebugDOTOut io.WriteCloser
|
||||
DisableNewline bool
|
||||
}
|
||||
|
||||
type EncodeFormat struct {
|
||||
|
|
Loading…
Reference in New Issue