From: Christian Höppner Date: Mon, 28 Aug 2023 13:12:08 +0000 (+0200) Subject: encoding/json: adjust comment about encoding \b and \f X-Git-Tag: go1.22rc1~1060 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3db23523b81a25264a7f3170fd60c09374db7717;p=gostls13.git 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 Run-TryBot: Joseph Tsai TryBot-Result: Gopher Robot Reviewed-by: Joseph Tsai --- 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