From 5818c9d714f1a8abeb76ec5d75ad0e0560e8d780 Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Mon, 8 Dec 2025 14:22:12 -0800 Subject: 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 Reviewed-by: Joseph Tsai Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- src/encoding/json/jsontext/encode.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/encoding/json/jsontext/encode.go') 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, -- cgit v1.3