Documentation ¶
Overview ¶
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: https://golang.org/doc/articles/json_and_go.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InvalidUTF8Error ¶
type InvalidUTF8Error struct {
S string // the whole string value that caused the error
}
Before Go 1.2, an InvalidUTF8Error was returned by Marshal when attempting to encode a string value with invalid UTF-8 sequences. As of Go 1.2, Marshal instead coerces the string to valid UTF-8 by replacing invalid bytes with the Unicode replacement rune U+FFFD. This error is no longer generated but is kept for backwards compatibility with programs that might mention it.
func (*InvalidUTF8Error) Error ¶
func (e *InvalidUTF8Error) Error() string
type Marshaler ¶
Marshaler is the interface implemented by types that can marshal themselves into valid JSON.
type MarshalerError ¶
func (*MarshalerError) Error ¶
func (e *MarshalerError) Error() string
type SyntaxError ¶
type SyntaxError struct { Offset int64 // error occurred after reading Offset bytes // contains filtered or unexported fields }
A SyntaxError is a description of a JSON syntax error.
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
type UnsupportedTypeError ¶
An UnsupportedTypeError is returned by Marshal when attempting to encode an unsupported value type.
func (*UnsupportedTypeError) Error ¶
func (e *UnsupportedTypeError) Error() string
type UnsupportedValueError ¶
func (*UnsupportedValueError) Error ¶
func (e *UnsupportedValueError) Error() string