go.dev·4 november 2026

A new Go API for JSON

Image for the article: A new Go API for JSON
Image via go.dev

Go 1.27 introduces stable encoding/json/v2 and encoding/json/jsontext packages, addressing long-standing issues with the original encoding/json API. The new API improves JSON syntax handling, fixes behavior flaws like duplicate member names and nilness leaks, and enhances performance. It also resolves API deficiencies, such as case-insensitive unmarshaling and inconsistent method calling. These updates make JSON processing in Go more robust and secure.