summaryrefslogtreecommitdiff
path: root/encode.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-26 13:59:35 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-29 02:14:35 -0700
commitcf062e09037c7e54a821b05ef50b3e86683090f8 (patch)
tree2774971350856aba2c0607827eece0cabd63de52 /encode.go
parent403c22024921af1d66c6a3de7ee6431043465c39 (diff)
Improve/fix documentation and comments
Diffstat (limited to 'encode.go')
-rw-r--r--encode.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/encode.go b/encode.go
index d31f36e..41032e5 100644
--- a/encode.go
+++ b/encode.go
@@ -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 {