aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/stream.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2016-04-13 18:14:52 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2016-04-16 22:11:57 +0000
commit462aa7ec7b854f5a1bb4f633cb439eb67bced625 (patch)
treefe9e680b036560c094bfa728f510bc1cef06156a /src/encoding/json/stream.go
parent2cdcb6f8296b6528bb7d256a45e339c4aefb9109 (diff)
downloadgo-462aa7ec7b854f5a1bb4f633cb439eb67bced625.tar.xz
encoding/json: update docs to not use misuse the term "object"
In JSON terminology, "object" is a collect of key/value pairs. But a JSON object is only one type of JSON value (others are string, number, array, true, false, null). This updates the Go docs (at least the public godoc) to not use "object" when we mean any JSON value. Change-Id: Ieb1c456c703693714d63d9d09d306f4d9e8f4597 Reviewed-on: https://go-review.googlesource.com/22003 Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'src/encoding/json/stream.go')
-rw-r--r--src/encoding/json/stream.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/encoding/json/stream.go b/src/encoding/json/stream.go
index b740d32a7d..422837bb63 100644
--- a/src/encoding/json/stream.go
+++ b/src/encoding/json/stream.go
@@ -10,7 +10,7 @@ import (
"io"
)
-// A Decoder reads and decodes JSON objects from an input stream.
+// A Decoder reads and decodes JSON values from an input stream.
type Decoder struct {
r io.Reader
buf []byte
@@ -164,7 +164,7 @@ func nonSpace(b []byte) bool {
return false
}
-// An Encoder writes JSON objects to an output stream.
+// An Encoder writes JSON values to an output stream.
type Encoder struct {
w io.Writer
err error
@@ -218,14 +218,14 @@ func (enc *Encoder) Encode(v interface{}) error {
return err
}
-// Indent sets the encoder to format each encoded object with Indent.
+// Indent sets the encoder to format each encoded value with Indent.
func (enc *Encoder) Indent(prefix, indent string) {
enc.indentBuf = new(bytes.Buffer)
enc.indentPrefix = prefix
enc.indentValue = indent
}
-// RawMessage is a raw encoded JSON object.
+// RawMessage is a raw encoded JSON value.
// It implements Marshaler and Unmarshaler and can
// be used to delay JSON decoding or precompute a JSON encoding.
type RawMessage []byte