aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/v2_encode.go
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2025-06-30 22:17:41 -0700
committerGopher Robot <gobot@golang.org>2025-07-14 07:58:11 -0700
commitc6556b8eb3444b6d5473762ed1082039db7e03b5 (patch)
tree243f19e74f46a96c16df83d66d5c7e6632ed4fbc /src/encoding/json/v2_encode.go
parent6ebb5f56d9ed35588970ce69cbad63508403bb8d (diff)
downloadgo-c6556b8eb3444b6d5473762ed1082039db7e03b5.tar.xz
encoding/json/v2: add security section to doc
This follows up CL 684315 with an expanded section in the v2 doc. Updates #14750 Updates #71845 Change-Id: I1ffa97e030f5f2b709e8142028e3c8e0e38b80ce Reviewed-on: https://go-review.googlesource.com/c/go/+/685195 Auto-Submit: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/encoding/json/v2_encode.go')
-rw-r--r--src/encoding/json/v2_encode.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/encoding/json/v2_encode.go b/src/encoding/json/v2_encode.go
index cbb167dbd0..c2d620bcbb 100644
--- a/src/encoding/json/v2_encode.go
+++ b/src/encoding/json/v2_encode.go
@@ -10,6 +10,14 @@
//
// See "JSON and Go" for an introduction to this package:
// https://golang.org/doc/articles/json_and_go.html
+//
+// # Security Considerations
+//
+// See the "Security Considerations" section in [encoding/json/v2].
+//
+// For historical reasons, the default behavior of v1 [encoding/json]
+// unfortunately operates with less secure defaults.
+// New usages of JSON in Go are encouraged to use [encoding/json/v2] instead.
package json
import (