mirror of
https://github.com/golang/go.git
synced 2025-11-08 20:51:02 +00:00
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>
This commit is contained in:
parent
2cdcb6f829
commit
462aa7ec7b
3 changed files with 11 additions and 11 deletions
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package json implements encoding and decoding of JSON objects as defined in
|
||||
// RFC 4627. The mapping between JSON objects and Go values is described
|
||||
// Package json implements encoding and decoding of JSON as defined in
|
||||
// RFC 4627. The mapping between JSON and Go values is described
|
||||
// in the documentation for the Marshal and Unmarshal functions.
|
||||
//
|
||||
// See "JSON and Go" for an introduction to this package:
|
||||
|
|
@ -52,7 +52,7 @@ import (
|
|||
//
|
||||
// Array and slice values encode as JSON arrays, except that
|
||||
// []byte encodes as a base64-encoded string, and a nil slice
|
||||
// encodes as the null JSON object.
|
||||
// encodes as the null JSON value.
|
||||
//
|
||||
// Struct values encode as JSON objects. Each exported struct field
|
||||
// becomes a member of the object unless
|
||||
|
|
@ -121,10 +121,10 @@ import (
|
|||
// keys, subject to the UTF-8 coercion described for string values above.
|
||||
//
|
||||
// Pointer values encode as the value pointed to.
|
||||
// A nil pointer encodes as the null JSON object.
|
||||
// A nil pointer encodes as the null JSON value.
|
||||
//
|
||||
// Interface values encode as the value contained in the interface.
|
||||
// A nil interface value encodes as the null JSON object.
|
||||
// A nil interface value encodes as the null JSON value.
|
||||
//
|
||||
// Channel, complex, and function values cannot be encoded in JSON.
|
||||
// Attempting to encode such a value causes Marshal to return
|
||||
|
|
@ -192,7 +192,7 @@ func HTMLEscape(dst *bytes.Buffer, src []byte) {
|
|||
}
|
||||
}
|
||||
|
||||
// Marshaler is the interface implemented by objects that
|
||||
// Marshaler is the interface implemented by types that
|
||||
// can marshal themselves into valid JSON.
|
||||
type Marshaler interface {
|
||||
MarshalJSON() ([]byte, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue