encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159. 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: https://golang.org/doc/articles/json_and_go.html
API
func Compact(dst *bytes.Buffer, src []byte) error
func HTMLEscape(dst *bytes.Buffer, src []byte)
func Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error
func Marshal(v interface{}) ([]byte, error)
func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
func Unmarshal(data []byte, v interface{}) error
func Valid(data []byte) bool
type Decoder
func NewDecoder(r io.Reader) *Decoder
func (dec *Decoder) Buffered() io.Reader
func (dec *Decoder) Decode(v interface{}) error
func (dec *Decoder) DisallowUnknownFields()
func (dec *Decoder) More() bool
func (dec *Decoder) Token() (Token, error)
func (dec *Decoder) UseNumber()
type Delim
func (d Delim) String() string
type Encoder
func NewEncoder(w io.Writer) *Encoder
func (enc *Encoder) Encode(v interface{}) error
func (enc *Encoder) SetEscapeHTML(on bool)
func (enc *Encoder) SetIndent(prefix, indent string)
type InvalidUTF8Error
func (e *InvalidUTF8Error) Error() string
type InvalidUnmarshalError
func (e *InvalidUnmarshalError) Error() string
type Marshaler
type MarshalerError
func (e *MarshalerError) Error() string
type Number
func (n Number) Float64() (float64, error)
func (n Number) Int64() (int64, error)
func (n Number) String() string
type RawMessage
func (m RawMessage) MarshalJSON() ([]byte, error)
func (m *RawMessage) UnmarshalJSON(data []byte) error
type SyntaxError
func (e *SyntaxError) Error() string
type Token
type UnmarshalFieldError
func (e *UnmarshalFieldError) Error() string
type UnmarshalTypeError
func (e *UnmarshalTypeError) Error() string
type Unmarshaler
type UnsupportedTypeError
func (e *UnsupportedTypeError) Error() string
type UnsupportedValueError
func (e *UnsupportedValueError) Error() string