Skip to content

Commit 3db2352

Browse files
committed
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 <[email protected]> Run-TryBot: Joseph Tsai <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Joseph Tsai <[email protected]>
1 parent e9c14a7 commit 3db2352

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/encoding/json/encode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ func appendString[Bytes []byte | string](dst []byte, src Bytes, escapeHTML bool)
980980
case '\t':
981981
dst = append(dst, '\\', 't')
982982
default:
983-
// This encodes bytes < 0x20 except for \t, \n and \r.
983+
// This encodes bytes < 0x20 except for \b, \f, \n, \r and \t.
984984
// If escapeHTML is set, it also escapes <, >, and &
985985
// because they can lead to security holes when
986986
// user-controlled strings are rendered into JSON

0 commit comments

Comments
 (0)