]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: adjust comment about encoding \b and \f
authorChristian Höppner <hoeppi@google.com>
Mon, 28 Aug 2023 13:12:08 +0000 (15:12 +0200)
committerChristian Höppner <hoeppi@google.com>
Tue, 29 Aug 2023 06:07:22 +0000 (06:07 +0000)
The encoding for the control characters \b and \f was
changed in http://go.dev/cl/521675. This CL adjusts the
corresponding comment about encoding bytes < 0x20.

Change-Id: I83b7311e4fa0731f6601ca64a66042425b4cecac
Reviewed-on: https://go-review.googlesource.com/c/go/+/523435
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
src/encoding/json/encode.go

index 2752fcc86db55f620dfe885357542f8a657dd800..6fee1dc00b6ff4477d5f26d94362e95004f95b09 100644 (file)
@@ -980,7 +980,7 @@ func appendString[Bytes []byte | string](dst []byte, src Bytes, escapeHTML bool)
                        case '\t':
                                dst = append(dst, '\\', 't')
                        default:
-                               // This encodes bytes < 0x20 except for \t, \n and \r.
+                               // This encodes bytes < 0x20 except for \b, \f, \n, \r and \t.
                                // If escapeHTML is set, it also escapes <, >, and &
                                // because they can lead to security holes when
                                // user-controlled strings are rendered into JSON