encoding/json

Go's standard library package for converting between Go values and JSON text.

In more detail

json.Marshal and json.Unmarshal convert whole values at once; json.NewEncoder and json.NewDecoder work on streams. It only sees exported struct fields, and struct tags control the JSON key names. Malformed input comes back as an error, never a half-filled guess.

Example

import "encoding/json"

Related terms

Taught in

References