aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/jsontext/encode.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2025-12-08 14:22:12 -0800
committerGopher Robot <gobot@golang.org>2025-12-11 09:37:03 -0800
commit5818c9d714f1a8abeb76ec5d75ad0e0560e8d780 (patch)
tree862b68a048789dd998059fdcea397ab53d5bcabf /src/encoding/json/jsontext/encode.go
parent9de6468701f4def1bbdc737e8ad1327f2cfaecc8 (diff)
downloadgo-5818c9d714f1a8abeb76ec5d75ad0e0560e8d780.tar.xz
encoding/json/jsontext: add symbolic Kind constants
Add constants for each possible Kind value (KindNull, KindTrue, etc.). Leave the values unchanged ('n', 't', etc.). Update documentation to reference the symbols. Fixes #71756 Change-Id: Ib33b2ad9ee55f6f547d9e6a1c5a7f00c8400d3d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/728420 Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/encoding/json/jsontext/encode.go')
-rw-r--r--src/encoding/json/jsontext/encode.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/encoding/json/jsontext/encode.go b/src/encoding/json/jsontext/encode.go
index e3b9c04ca6..20f020700b 100644
--- a/src/encoding/json/jsontext/encode.go
+++ b/src/encoding/json/jsontext/encode.go
@@ -946,9 +946,9 @@ func (e *Encoder) StackDepth() int {
// It must be a number between 0 and [Encoder.StackDepth], inclusive.
// For each level, it reports the kind:
//
-// - 0 for a level of zero,
-// - '{' for a level representing a JSON object, and
-// - '[' for a level representing a JSON array.
+// - [KindInvalid] for a level of zero,
+// - [KindBeginObject] for a level representing a JSON object, and
+// - [KindBeginArray] for a level representing a JSON array.
//
// It also reports the length of that JSON object or array.
// Each name and value in a JSON object is counted separately,