]> Cypherpunks repositories - gostls13.git/commit
encoding/json: clarify omitempty option for {array,slice,map,string}
authorJes Cok <xigua67damn@gmail.com>
Tue, 22 Oct 2024 14:56:13 +0000 (14:56 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 23 Oct 2024 15:18:51 +0000 (15:18 +0000)
commit9f26d35fac2958cb6cbaafe676bb438584bcfbd0
tree16b44f58904bf8b5d7d5e8cf14253659e5362149
parent3cb0c039e9bdc4bf8ca7cc31dc7432f9f37d4079
encoding/json: clarify omitempty option for {array,slice,map,string}

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 <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/encoding/json/encode.go