diff options
Diffstat (limited to 'libgo/go/encoding/json/stream.go')
-rw-r--r-- | libgo/go/encoding/json/stream.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgo/go/encoding/json/stream.go b/libgo/go/encoding/json/stream.go index 1928abadb7..9566ecadcb 100644 --- a/libgo/go/encoding/json/stream.go +++ b/libgo/go/encoding/json/stream.go @@ -139,7 +139,6 @@ func nonSpace(b []byte) bool { // An Encoder writes JSON objects to an output stream. type Encoder struct { w io.Writer - e encodeState err error } @@ -148,7 +147,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 +173,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 } |