ALEXKRI.NET
Resume Contact
← Back

A new Go API for JSON

Six years in the making: encoding/json/v2 is stable in Go 1.27, and Unmarshal is up to 10x faster — Kubernetes saw one service improve by orders of magnitude after switching to UnmarshalJSONFrom. The breaking defaults are worth reading, though: duplicate keys now error, field matching is case-sensitive, nil slices marshal as [] instead of null. v1 stays supported indefinitely and is built on top of v2, so you can migrate per call.

Read the source ↗