From 3db23523b81a25264a7f3170fd60c09374db7717 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20H=C3=B6ppner?= Date: Mon, 28 Aug 2023 15:12:08 +0200 Subject: [PATCH] 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 --- src/encoding/json/encode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.50.0