Examples using... "encoding/json"

Recent
StructOf returns the struct type containing fields. The Offset and Index fields are ignored and computed as they would be by the compiler.
StdoutPipe returns a pipe that will be connected to the command's standard output when the command starts.
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.
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.
Valid reports whether data is a valid JSON encoding.
Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. If v is nil or not a pointer, Unmarshal returns an InvalidUnmarshalError.
This example uses RawMessage to delay parsing part of a JSON message.
This example uses RawMessage to use a precomputed JSON during marshal.
MarshalIndent is like Marshal but applies Indent to format the output. Each JSON element in the output will begin on a new line beginning with prefix followed by one or more copies of indent according to the indentation nesting.
Marshal returns the JSON encoding of v.
Indent appends to dst an indented form of the JSON-encoded src. Each element in a JSON object or array begins on a new, indented line beginning with prefix followed by one or more copies of indent according to the indentation nesting. The data appended to dst does not begin with the prefix nor any i...
HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029 characters inside string literals changed to \u003c, \u003e, \u0026, \u2028, \u2029 so that the JSON will be safe to embed inside HTML <script> tags. For historical reasons, web browsers don't honor standard HTML escaping...
This example uses a Decoder to decode a stream of distinct JSON values.
This example uses a Decoder to decode a streaming array of JSON objects.
This example uses a Decoder to decode a stream of distinct JSON values.
Go offers built-in support for JSON encoding and decoding, including to and from built-in and custom data types.