encoding/jsonMarshal and unmarshal JSON with struct tags.
type User struct {
Name string `json:"name"`
Age int `json:"age,omitempty"`
}
b, err := json.Marshal(User{Name: "Ada", Age: 36})
var u User
err = json.Unmarshal(b, &u)
dec := json.NewDecoder(r)
enc := json.NewEncoder(w)
Decoder respects io.Reader streaming; use DisallowUnknownFields() for strict APIs.
json.RawMessageDelay parsing of nested blobs.
By default Decoder unmarshals numbers to float64. Use Decoder.UseNumber() and json.Number for big integers/decimals without float loss when appropriate.
SetEscapeHTML(false) on Encoder when writing non-HTML contexts.
easyjson, jsoniter, or codegen exist for hot paths — profile first.