Release201 comments in the community
A new Go API for JSON
The Go Blog · By Michael Pratt, Joe Tsai, Daniel Martí, Johan Brandhorst-Satzkorn, Roger Peppe, Chris Hines, and Damien Neil ·
The Go Blog A new Go API for JSON Michael Pratt, Joe Tsai, Daniel Martí, Johan Brandhorst-Satzkorn, Roger Peppe, Chris Hines, and Damien Neil 4 November 2026 Introduction JavaScript Object Notation (JSON) is a simple data interchange format, the most popular data format used on…
The Brief
- The Go Blog published "A new Go API for JSON" on 4 November 2026, written by Michael Pratt, Joe Tsai, Daniel Martí, Johan Brandhorst-Satzkorn, Roger Peppe, Chris Hines and Damien Neil.
- The post introduces a new JSON API for Go; commenters name the packages encoding/json/v2 and jsontext.
- The announcement drew 378 points and 190 comments on Hacker News and 8 points and 2 comments on Lobsters.
Why it matters
Go developers who use encoding/json will eventually need to know the new API and its changed behaviour, such as nil slices and maps marshaling as an empty JSON array or object by default, as one commenter quoted.
Who’s affected
- Go developers using encoding/json
- Teams maintaining Go services that serialize JSON
- #go
- #json
- #stdlib
- #encoding
- #api-design
What developers are saying
Based on 201 comments · Mixed reactions
Commenters generally welcome the new API as a long-overdue cleanup of Go's JSON handling, with praise for the jsontext package's error handling and speed. Criticism focuses on the removal of MarshalIndent, the nil slice and map default, and the six-year timeline. Some note that the order-preserving JSON problem is still unsolved.
- Welcome long-overdue cleanup30%
- Missing MarshalIndent10%
- Nil slice default concerns5%
- Six-year timeline8%
- AI-assisted coding context12%
In favour
- + Marshal erroring on unmarshalable types is seen as a design flaw that the new API fixes
- + jsontext offers specific error reporting with good performance
- + Changes make JSON handling feel less awkward to developers
Concerns
- − MarshalIndent was removed, which makes quick readable output harder
- − Nil slices and maps marshaling as empty arrays or objects by default may cause bugs and need a future v3 fix
- − Six years to land the API seems very long
- − Preserving key order in JSON is still not solved in the standard library
“I wish they'd left `MarshalIndent` in there though.”
“But 6 years seems like a lot of work to land a JSON API.”
“There is no introspection and speed is superb.”