A new Go API for JSON
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
The Go team announced that encoding/json/v2 and encoding/json/jsontext are stable in Go 1.27, a status the post itself doesn't source. v2 rejects invalid UTF-8 and duplicate member names, marshals nil slices and maps as empty values, and matches field names case-sensitively. Unmarshal is up to 10x faster than v1, while Marshal is roughly equal. Larger gains need the streaming MarshalJSONTo and UnmarshalJSONFrom methods; the Kubernetes speedup is unverified. v1 remains supported and runs on v2 options, so migration can be gradual.