diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-29 02:15:13 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-29 02:15:13 -0700 |
commit | 0b57145421e7e4f165f64e73ee7c5d8102945569 (patch) | |
tree | 25584309e42bb53469959a3725393bdbc8b225c7 /encode.go | |
parent | ffee5c8516f3f55f82ed5bb8f0a4f340d485fa92 (diff) | |
parent | 7e00adcf43b18a22ffbbadc79b8681a5d871f448 (diff) |
Merge branch 'lukeshu/quality'
This branch works to improve code quality, without making any
substantive changes.
Diffstat (limited to 'encode.go')
-rw-r--r-- | encode.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -61,11 +61,14 @@ type Encoder struct { closeAfterEncode bool } -// NewEncoder returns a new encoder. +// NewEncoder returns a new Encoder that writes to w. // // If w is an *ReEncoder, then the inner backslash-escaping of // double-encoded ",string" tagged string values obeys the // *ReEncoder's BackslashEscape policy. +// +// An Encoder tends to make many small writes; if w.Write calls are +// syscalls, then you may want to wrap w in a bufio.Writer. func NewEncoder(w io.Writer) *Encoder { re, ok := w.(*ReEncoder) if !ok { |