diff options
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 { |