diff options
Diffstat (limited to 'src/pkg/encoding/json/stream.go')
-rw-r--r-- | src/pkg/encoding/json/stream.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/encoding/json/stream.go b/src/pkg/encoding/json/stream.go index 1928abadb..1cb289fd8 100644 --- a/src/pkg/encoding/json/stream.go +++ b/src/pkg/encoding/json/stream.go @@ -148,7 +148,8 @@ func NewEncoder(w io.Writer) *Encoder { return &Encoder{w: w} } -// Encode writes the JSON encoding of v to the stream. +// Encode writes the JSON encoding of v to the stream, +// followed by a newline character. // // See the documentation for Marshal for details about the // conversion of Go values to JSON. @@ -173,7 +174,7 @@ func (enc *Encoder) Encode(v interface{}) error { if _, err = enc.w.Write(e.Bytes()); err != nil { enc.err = err } - putEncodeState(e) + encodeStatePool.Put(e) return err } |