]> Cypherpunks repositories - gostls13.git/commit
encoding/json: fix regression in quoted numbers under goexperiment.jsonv2
authorJoe Tsai <joetsai@digital-static.net>
Mon, 6 Oct 2025 19:56:29 +0000 (12:56 -0700)
committerJoseph Tsai <joetsai@digital-static.net>
Sat, 11 Oct 2025 01:03:36 +0000 (18:03 -0700)
commitb497a29d25b0f6f29bedaa92ac1d40a1ee5c0956
tree07ed48d5f97abb6ef8e9de1fc48e12fbc1f7ac96
parent48bb7a61147c397d0f45c10bc21ba12fa9cec0ad
encoding/json: fix regression in quoted numbers under goexperiment.jsonv2

The legacy parsing of quoted numbers in v1 was according to
the Go grammar for a number, rather than
the JSON grammar for a number.
The former is a superset of the latter.

This is a historical mistake, but usages exist that depend on it.
We already have branches for StringifyWithLegacySemantics
to handle quoted nulls, so we can expand it to handle this.

Fixes #75619

Change-Id: Ic07802539b7cbe0e1f53bd0f7e9bb344a8447203
Reviewed-on: https://go-review.googlesource.com/c/go/+/709615
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/encoding/json/decode_test.go
src/encoding/json/v2/arshal_default.go
src/encoding/json/v2_decode_test.go
src/encoding/json/v2_options.go