A new Go API for JSON
The Go team has released encoding/json/v2 and encoding/json/jsontext, a new stable JSON API in Go 1.27 designed to address behavioral flaws and performance limitations in the original package. The new v2 packages separate syntax from semantics, introduce streaming-oriented JSON encoding and decoding interfaces, reject invalid UTF-8 and duplicate object keys by default, and provide options-based configuration. Despite these structural improvements and up to 10x faster unmarshaling performance, v1 is implemented under the hood in terms of v2 to ensure backward compatibility and smooth ecosystem migration. Open article →