]> Cypherpunks repositories - gostls13.git/commit
encoding/json/v2: document context annotation with SemanticError
authorJoe Tsai <joetsai@digital-static.net>
Tue, 9 Sep 2025 00:33:47 +0000 (17:33 -0700)
committerJoseph Tsai <joetsai@digital-static.net>
Wed, 10 Sep 2025 07:58:35 +0000 (00:58 -0700)
commit30686c4cc89e6952ec00846e34016f37d53f31dd
tree3a9648a9c491c5e12d9b6df0f24815d0256bc429
parentc5737dc21bbac9fbefc35ac9313e66291d66b382
encoding/json/v2: document context annotation with SemanticError

When the json package calls
Marshaler, MarshalerTo, Unmarshaler, or UnmarshalerFrom methods
and a SemanticError is returned, it will automatically
annotate the error with context.

Document this behavior.

Change-Id: Id8e775a7c1c2a6ffc29ea518913591915e8aff87
Reviewed-on: https://go-review.googlesource.com/c/go/+/701956
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/encoding/json/v2/arshal_methods.go
src/encoding/json/v2/errors.go
src/encoding/json/v2/example_orderedobject_test.go