Skip to content

Glossary: Go Beyond the Basics

json.Marshal / json.Unmarshal

Also written: Marshal, Unmarshal, marshal, unmarshal, MarshalIndent

`Marshal` turns a Go value into JSON bytes, and `Unmarshal` fills a Go value from JSON (give it a pointer). `MarshalIndent` does the same as `Marshal` with one field per line for people.

Where the book teaches it

Related terms

struct tagjson.NewEncoder / json.NewDecoder