]> Cypherpunks.ru repositories - gostls13.git/commit
encoding/json: use append for HTMLEscape
authorJoe Tsai <joetsai@digital-static.net>
Mon, 20 Feb 2023 08:42:27 +0000 (00:42 -0800)
committerGopher Robot <gobot@golang.org>
Mon, 27 Feb 2023 17:33:26 +0000 (17:33 +0000)
commit2de406bb9e26df19a31b5f6111bb221b60964d48
tree024c7be050abfaa8ab8276b9ffac0445b927c9a9
parent0b5affb193ed559f2cb646e0324827f261e2e767
encoding/json: use append for HTMLEscape

Use append for HTMLEscape similar to Indent and Compact.
Move it to indent.go alongside Compact, as it shares similar logic.
In a future CL, we will modify appendCompact to be written in terms
of appendHTMLEscape, but we need to first move the JSON decoder logic
out of the main loop of appendCompact.

Change-Id: I131c64cd53d5d2b4ca798b37349aeefe17b418c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/471198
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
src/encoding/json/encode.go
src/encoding/json/indent.go