diff options
author | Christian Höppner <hoeppi@google.com> | 2023-08-28 15:12:08 +0200 |
---|---|---|
committer | Christian Höppner <hoeppi@google.com> | 2023-08-29 06:07:22 +0000 |
commit | 3db23523b81a25264a7f3170fd60c09374db7717 (patch) | |
tree | 3665bd394155cc732004a8180d159d08df500c69 /src/encoding | |
parent | e9c14a77803a3e80d6697c70bb79d8accd0d2290 (diff) | |
download | go-3db23523b81a25264a7f3170fd60c09374db7717.tar.gz go-3db23523b81a25264a7f3170fd60c09374db7717.zip |
encoding/json: adjust comment about encoding \b and \f
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>
Diffstat (limited to 'src/encoding')
-rw-r--r-- | src/encoding/json/encode.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index 2752fcc86d..6fee1dc00b 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -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 |