Deep Dive Into Go's encoding/json/v2 Internals, Praised by Go Lead
rseroter · x · 2026-12-02
Jesús Espino published an 18-minute deep dive on Internals for Interns explaining the internals of Go 1.27's encoding/json/v2.
- Why v2 exists: the old encoding/json has been around since Go 1.0, but its defaults—accepting duplicate names and invalid UTF-8, encoding nil slices as null, case-insensitive field matching—can't change without breaking users. json/v2 is a rewrite with stricter defaults, and v1 is now a thin wrapper on top.
- Approach: the article follows one small JSON document (string, number, bool, null, array, nested object) through json.Unmarshal and json.Marshal, opening each component as data reaches it.
- Scope: based on Go 1.27.3 where json/v2 is enabled by default; covers the main path only, skipping streaming, custom marshalers, struct tag options, error handling, and the v1 compat layer.
The reshare comes from Ryan Seroter, who leads product/eng for Go, calling it his favorite genre of tech blog and admitting he didn't know all the details.
More from coding & agent
- Agent trust layer One raises $7M, covers 160K+ tools for free — heyronir · 2026-12-02
- Dev argues to drop code review and gate on actually using the output — sloppenheimer · 2026-12-02
- Astral ships ty 1.0: 24x faster Python type checker, 73% less memory — abhishek__AI · 2026-12-02
- Enterprise AI prototype graveyards: why security review can't keep up with coding agents — aakashgupta · 2026-12-02
- The new B2B: getting ahold of the customer's agent — josh_bickett · 2026-12-02
- X.com rewrite lead Yagiz Nizipli to detail the full rebuild in online talk — threepointone · 2026-12-02