Does Go 1.27's json v2 break your LLM parsing? We tested

In our test, the classic `encoding/json` API returned identical results on Go 1.26.9 and Go 1.27.2 for 11 payloads, including invalid UTF-8 and duplicate keys.

The new `encoding/json/v2` package is stricter: it rejected invalid UTF-8, duplicate keys and a lone surrogate that v1 accepted, and it marshals a nil slice as `[]` instead of `null`.

`json.Unmarshal` on Go 1.27.2 took a median 763 ns against 1,774 ns on Go 1.26.9, 2.3 times faster, while `json.Marshal` was about 9% slower.

Upgrade without fear, then use the v2 package as a strict validator for model output.

Read the full post

Read the full post