This commit is contained in:
a 2023-07-19 21:01:41 -05:00
parent 76a5d06ee7
commit 260c426a4c
No known key found for this signature in database
GPG Key ID: 374BC539FE795AF0
1 changed files with 3 additions and 1 deletions

View File

@ -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
} }