<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/encoding/json/encode.go, branch fix-runtime-test-GOMAXPROCS</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=fix-runtime-test-GOMAXPROCS</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=fix-runtime-test-GOMAXPROCS'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2025-06-27T20:38:47Z</updated>
<entry>
<title>encoding/json: add security section to doc</title>
<updated>2025-06-27T20:38:47Z</updated>
<author>
<name>Roland Shoemaker</name>
<email>roland@golang.org</email>
</author>
<published>2025-06-26T19:19:23Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=2a22aefa1f7befb0ac7a95c918b75b05919c1907'/>
<id>urn:sha1:2a22aefa1f7befb0ac7a95c918b75b05919c1907</id>
<content type='text'>
Add a section to the package doc which details the security
considerations of using encoding/json, in particular with respect to
parser misalignment issues.

Additionally, clarify previously ambiguous statement in the Unmarshal
doc about how case is used when matching keys in objects, and add a note
about how duplicate keys are handled.

Fixes #14750

Change-Id: I66f9b845efd98c86a684d7333b3aa8a456564922
Reviewed-on: https://go-review.googlesource.com/c/go/+/684315
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Auto-Submit: Roland Shoemaker &lt;roland@golang.org&gt;
Reviewed-by: Damien Neil &lt;dneil@google.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: avoid supurious synctest deadlock detection</title>
<updated>2025-05-20T22:46:07Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2025-05-15T18:03:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=68bc0d84e9dd74a02472bfff744e0650b4b1653c'/>
<id>urn:sha1:68bc0d84e9dd74a02472bfff744e0650b4b1653c</id>
<content type='text'>
Use a sync.OnceValue rather than a sync.WaitGroup to
coordinate access to encoderCache entries.

The OnceValue better expresses the intent of the code
(we want to initialize the cache entry only once).

However, the motivation for this change is to avoid
testing/synctest incorrectly reporting a deadlock
when multiple bubbles call Marshal at the same time.
Goroutines blocked on WaitGroup.Wait are "durably blocked",
causing confusion when a goroutine in one bubble Waits
for a goroutine in a different bubble. Goroutines blocked
on OnceValue are not durably blocked, avoiding the problem.

Fixes #73733
For #67434

Change-Id: I81cddda80af67cf5c280fd4327620bc37e7a6fe6
Reviewed-on: https://go-review.googlesource.com/c/go/+/673335
Auto-Submit: Damien Neil &lt;dneil@google.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: add json/v2 with GOEXPERIMENT=jsonv2 guard</title>
<updated>2025-04-18T15:24:07Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2025-04-11T21:19:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=0e17905793cb5e0acc323a0cdf3733199d93976a'/>
<id>urn:sha1:0e17905793cb5e0acc323a0cdf3733199d93976a</id>
<content type='text'>
This imports the proposed new v2 JSON API implemented in
github.com/go-json-experiment/json as of commit
d3c622f1b874954c355e60c8e6b6baa5f60d2fed.

When GOEXPERIMENT=jsonv2 is set, the encoding/json/v2 and
encoding/jsontext packages are visible, the encoding/json
package is implemented in terms of encoding/json/v2, and
the encoding/json package include various additional APIs.
(See #71497 for details.)

When GOEXPERIMENT=jsonv2 is not set, the new API is not
present and the encoding/json package is unchanged.

The experimental API is not bound by the Go compatibility
promise and is expected to evolve as updates are made to
the json/v2 proposal.

The contents of encoding/json/internal/jsontest/testdata
are compressed with zstd v1.5.7 with the -19 option.

Fixes #71845
For #71497

Change-Id: Ib8c94e5f0586b6aaa22833190b41cf6ef59f4f01
Reviewed-on: https://go-review.googlesource.com/c/go/+/665796
Auto-Submit: Damien Neil &lt;dneil@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: use builtin min function in appendString</title>
<updated>2025-02-25T19:49:13Z</updated>
<author>
<name>Jes Cok</name>
<email>xigua67damn@gmail.com</email>
</author>
<published>2025-02-21T14:18:52Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=97571f36103b045a7e9c15a92e9a35ab95fa6be5'/>
<id>urn:sha1:97571f36103b045a7e9c15a92e9a35ab95fa6be5</id>
<content type='text'>
To make code a bit simpler.

Change-Id: I59fca1d5760e304abd53873ecf9ca8b2903e02e8
GitHub-Last-Rev: 1369df6da16121c342a4e678efe3e5b082485b74
GitHub-Pull-Request: golang/go#71873
Reviewed-on: https://go-review.googlesource.com/c/go/+/651355
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: clarify omitempty option for {array,slice,map,string}</title>
<updated>2024-10-23T15:18:51Z</updated>
<author>
<name>Jes Cok</name>
<email>xigua67damn@gmail.com</email>
</author>
<published>2024-10-22T14:56:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9f26d35fac2958cb6cbaafe676bb438584bcfbd0'/>
<id>urn:sha1:9f26d35fac2958cb6cbaafe676bb438584bcfbd0</id>
<content type='text'>
This CL is inspired by:
https://github.com/golang/go/issues/29310#issuecomment-758768325

When I read omitempty option in encoding/xml package, I find it's
a bit different than encoding/json package.

I think it's more precise to say:
"any array, slice, map, or string of length zero."

Update #29310

Change-Id: Ia77167c3155411640224b349d4b34d0bb91ee11e
GitHub-Last-Rev: a4cf00dcc75067bd259bc600f288c9de4b5393cf
GitHub-Pull-Request: golang/go#69984
Reviewed-on: https://go-review.googlesource.com/c/go/+/621835
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: add omitzero option</title>
<updated>2024-10-02T14:22:27Z</updated>
<author>
<name>Jes Cok</name>
<email>xigua67damn@gmail.com</email>
</author>
<published>2024-10-01T03:15:08Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=e86982c515ba4a494fb1f8e1367f4238a2b59c2e'/>
<id>urn:sha1:e86982c515ba4a494fb1f8e1367f4238a2b59c2e</id>
<content type='text'>
Fixes #45669

Change-Id: Ic13523c0b3acdfc5b3e29a717bc62fde302ed8fd
GitHub-Last-Rev: 57030f26b0062fa8eda21b3a73b7665deab88c76
GitHub-Pull-Request: golang/go#69622
Reviewed-on: https://go-review.googlesource.com/c/go/+/615676
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: rewrite interface{} to any</title>
<updated>2024-07-24T00:40:06Z</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2024-05-24T03:50:25Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=8659ad972f0f1fb389397cb35f810d9ccb36539f'/>
<id>urn:sha1:8659ad972f0f1fb389397cb35f810d9ccb36539f</id>
<content type='text'>
For #49884

Change-Id: I1623201c47c820a152773d2f43d0072a1466d3bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/588118
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Commit-Queue: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Mauri de Souza Meneguzzo &lt;mauri870@gmail.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Commit-Queue: Ian Lance Taylor &lt;iant@golang.org&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>encoding/json: clarify the map's key type for Unmarshal</title>
<updated>2024-06-21T18:42:18Z</updated>
<author>
<name>Jes Cok</name>
<email>xigua67damn@gmail.com</email>
</author>
<published>2024-06-18T15:43:21Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=72e2220b50db5179ddca2226a64bf1d3aa94f49a'/>
<id>urn:sha1:72e2220b50db5179ddca2226a64bf1d3aa94f49a</id>
<content type='text'>
While here, also fix doc link for encoding.TextMarshaler.

Fixes #67495

Change-Id: Ia2a674c5c35b5a849ce8f5eef3d34d165b3195b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/593335
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: David Chase &lt;drchase@google.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
</content>
</entry>
<entry>
<title>all: document legacy //go:linkname for modules with ≥20,000 dependents</title>
<updated>2024-05-23T00:18:55Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2024-05-22T03:24:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=bde905af5b11e3e34bc1f5d4846d7767f7197236'/>
<id>urn:sha1:bde905af5b11e3e34bc1f5d4846d7767f7197236</id>
<content type='text'>
For #67401.

Change-Id: Icc10ede72547d8020c0ba45e89d954822a4b2455
Reviewed-on: https://go-review.googlesource.com/c/go/+/587218
Auto-Submit: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: optimize field sorting with slices and cmp</title>
<updated>2024-04-29T14:01:21Z</updated>
<author>
<name>aimuz</name>
<email>mr.imuz@gmail.com</email>
</author>
<published>2024-04-28T01:52:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9e0685f9c24ff80a7e710e764c1090c680a5095c'/>
<id>urn:sha1:9e0685f9c24ff80a7e710e764c1090c680a5095c</id>
<content type='text'>
Refactor field sorting in typeFields to use slices.SortFunc and cmp.Compare,
resulting in performance improvements in cache misses and slight increases in
hit latency. Memory allocation and operation counts also reduced significantly
for cache misses.

goos: darwin
goarch: arm64
pkg: encoding/json
cpu: Apple M2 Max
                                    │   old.txt    │              new.txt               │
                                    │    sec/op    │   sec/op     vs base               │
TypeFieldsCache/MissTypes1-12          5.068µ ± 2%   5.032µ ± 1%       ~ (p=0.055 n=10)
TypeFieldsCache/MissTypes10-12         15.22µ ± 2%   14.79µ ± 2%  -2.84% (p=0.000 n=10)
TypeFieldsCache/MissTypes100-12        98.40µ ± 3%   94.72µ ± 1%  -3.73% (p=0.002 n=10)
TypeFieldsCache/MissTypes1000-12       860.3µ ± 3%   840.7µ ± 1%       ~ (p=0.105 n=10)
TypeFieldsCache/MissTypes10000-12      8.092m ± 3%   7.987m ± 4%       ~ (p=0.280 n=10)
TypeFieldsCache/MissTypes100000-12     80.90m ± 9%   80.62m ± 2%       ~ (p=0.631 n=10)
TypeFieldsCache/MissTypes1000000-12   1009.5m ± 7%   933.8m ± 7%  -7.50% (p=0.011 n=10)
TypeFieldsCache/HitTypes1-12           1.554n ± 3%   1.617n ± 3%  +4.05% (p=0.004 n=10)
TypeFieldsCache/HitTypes10-12          1.575n ± 1%   1.624n ± 6%  +3.14% (p=0.000 n=10)
TypeFieldsCache/HitTypes100-12         1.566n ± 1%   1.627n ± 5%  +3.86% (p=0.000 n=10)
TypeFieldsCache/HitTypes1000-12        1.526n ± 4%   1.596n ± 3%  +4.55% (p=0.001 n=10)
TypeFieldsCache/HitTypes10000-12       1.506n ± 0%   1.573n ± 3%  +4.41% (p=0.000 n=10)
TypeFieldsCache/HitTypes100000-12      1.480n ± 1%   1.529n ± 7%  +3.35% (p=0.001 n=10)
TypeFieldsCache/HitTypes1000000-12     1.473n ± 2%   1.468n ± 2%       ~ (p=0.739 n=10)
geomean                                1.371µ        1.374µ       +0.25%

                                    │     old.txt     │                new.txt                 │
                                    │      B/op       │     B/op       vs base                 │
TypeFieldsCache/MissTypes1-12          2.023Ki ± 0%      2.000Ki ± 0%  -1.16% (p=0.000 n=10)
TypeFieldsCache/MissTypes10-12         10.95Ki ± 0%      10.71Ki ± 0%  -2.17% (p=0.000 n=10)
TypeFieldsCache/MissTypes100-12       101.91Ki ± 0%      99.53Ki ± 0%  -2.34% (p=0.000 n=10)
TypeFieldsCache/MissTypes1000-12      1044.3Ki ± 0%     1020.8Ki ± 0%  -2.25% (p=0.000 n=10)
TypeFieldsCache/MissTypes10000-12      9.957Mi ± 0%      9.730Mi ± 0%  -2.29% (p=0.000 n=10)
TypeFieldsCache/MissTypes100000-12     97.79Mi ± 0%      95.50Mi ± 0%  -2.34% (p=0.000 n=10)
TypeFieldsCache/MissTypes1000000-12   1018.4Mi ± 0%      995.5Mi ± 0%  -2.25% (p=0.000 n=10)
TypeFieldsCache/HitTypes1-12             0.000 ± 0%        0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes10-12            0.000 ± 0%        0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes100-12           0.000 ± 0%        0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes1000-12          0.000 ± 0%        0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes10000-12         0.000 ± 0%        0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes100000-12        0.000 ± 0%        0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes1000000-12       0.000 ± 0%        0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                             ²                  -1.06%                ²
¹ all samples are equal
² summaries must be &gt;0 to compute geomean

                                    │    old.txt    │               new.txt                │
                                    │   allocs/op   │  allocs/op   vs base                 │
TypeFieldsCache/MissTypes1-12          46.00 ± 0%      45.00 ± 0%  -2.17% (p=0.000 n=10)
TypeFieldsCache/MissTypes10-12         215.0 ± 0%      205.0 ± 0%  -4.65% (p=0.000 n=10)
TypeFieldsCache/MissTypes100-12       1.845k ± 0%     1.745k ± 0%  -5.42% (p=0.000 n=10)
TypeFieldsCache/MissTypes1000-12      18.08k ± 0%     17.08k ± 0%  -5.53% (p=0.000 n=10)
TypeFieldsCache/MissTypes10000-12     180.3k ± 0%     170.3k ± 0%  -5.55% (p=0.000 n=10)
TypeFieldsCache/MissTypes100000-12    1.804M ± 0%     1.704M ± 0%  -5.54% (p=0.000 n=10)
TypeFieldsCache/MissTypes1000000-12   18.04M ± 0%     17.04M ± 0%  -5.54% (p=0.000 n=10)
TypeFieldsCache/HitTypes1-12           0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes10-12          0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes100-12         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes1000-12        0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes10000-12       0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes100000-12      0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
TypeFieldsCache/HitTypes1000000-12     0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                           ²                -2.49%                ²
¹ all samples are equal
² summaries must be &gt;0 to compute geomean

Change-Id: I62b8f524f5747f4f1b9241a1d849efeef1851049
GitHub-Last-Rev: d16772d4fb44f76e2688e15f1bdfc7db14bb55c6
GitHub-Pull-Request: golang/go#67046
Reviewed-on: https://go-review.googlesource.com/c/go/+/581895
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Joedian Reid &lt;joedian@google.com&gt;
</content>
</entry>
</feed>
