aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2026-02-12 10:42:52 -0800
committerJoseph Tsai <joetsai@digital-static.net>2026-02-13 15:29:29 -0800
commit770864f3b452dbd83e33e42b9659c387d03425b9 (patch)
treeef470d779a9a345f3c4bfe8e6096c26a8e521408 /src/encoding/json
parent1a6c5448a7004fb7073494ffdbd9bac5f1b8be9e (diff)
downloadgo-770864f3b452dbd83e33e42b9659c387d03425b9.tar.xz
encoding/json/v2: remove SkipFunc sentinel error
WARNING: This commit contains breaking changes for those already using GOEXPERIMENT=jsonv2. Existing users of SkipFunc should migrate to errors.ErrUnsupported, for which support was added in at least one prior commit. Updates #74324 Change-Id: Ifbdee39165a134a33ea0005bbc88df0df15f517f Reviewed-on: https://go-review.googlesource.com/c/go/+/745041 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Nicholas Husin <husin@google.com>
Diffstat (limited to 'src/encoding/json')
-rw-r--r--src/encoding/json/v2/arshal_funcs.go11
-rw-r--r--src/encoding/json/v2/example_test.go1
2 files changed, 1 insertions, 11 deletions
diff --git a/src/encoding/json/v2/arshal_funcs.go b/src/encoding/json/v2/arshal_funcs.go
index 1c325b16cb..860ff0b0f2 100644
--- a/src/encoding/json/v2/arshal_funcs.go
+++ b/src/encoding/json/v2/arshal_funcs.go
@@ -19,17 +19,6 @@ import (
"encoding/json/jsontext"
)
-// SkipFunc may be returned by [MarshalToFunc] and [UnmarshalFromFunc] functions.
-//
-// Any function that returns SkipFunc must not cause observable side effects
-// on the provided [jsontext.Encoder] or [jsontext.Decoder].
-// For example, it is permissible to call [jsontext.Decoder.PeekKind],
-// but not permissible to call [jsontext.Decoder.ReadToken] or
-// [jsontext.Encoder.WriteToken] since such methods mutate the state.
-//
-// Deprecated: Use [errors.ErrUnsupported] instead.
-var SkipFunc = errors.ErrUnsupported
-
var errUnsupportedMutation = errors.New("unsupported calls must not read or write any tokens")
var errNonSingularValue = errors.New("must read or write exactly one value")
diff --git a/src/encoding/json/v2/example_test.go b/src/encoding/json/v2/example_test.go
index b95ad0f73c..f8b42ce3de 100644
--- a/src/encoding/json/v2/example_test.go
+++ b/src/encoding/json/v2/example_test.go
@@ -8,6 +8,7 @@ package json_test
import (
"bytes"
+ "errors"
"fmt"
"log"
"math"