aboutsummaryrefslogtreecommitdiff
path: root/src/html/template/html.go
diff options
context:
space:
mode:
authorcuiweixie <cuiweixie@gmail.com>2022-09-04 17:59:50 +0800
committerGopher Robot <gobot@golang.org>2022-09-06 15:48:16 +0000
commit07b19bf5ab1160814ffedd448ce65c0eb6e9643a (patch)
tree8d8cb46b9ca27257930859a7dcb381de1dce20a9 /src/html/template/html.go
parent91a1b55489dfdc720ee4043390777e903c69222a (diff)
downloadgo-07b19bf5ab1160814ffedd448ce65c0eb6e9643a.tar.xz
html/template: use strings.Builder
Change-Id: Iab6ef8c6c74c09e8358f7d7088a82089725479ee Reviewed-on: https://go-review.googlesource.com/c/go/+/428260 Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/html/template/html.go')
-rw-r--r--src/html/template/html.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/html/template/html.go b/src/html/template/html.go
index 46e9d93151..bcca0b51a0 100644
--- a/src/html/template/html.go
+++ b/src/html/template/html.go
@@ -176,7 +176,7 @@ func htmlReplacer(s string, replacementTable []string, badRunes bool) string {
// stripTags takes a snippet of HTML and returns only the text content.
// For example, `<b>&iexcl;Hi!</b> <script>...</script>` -> `&iexcl;Hi! `.
func stripTags(html string) string {
- var b bytes.Buffer
+ var b strings.Builder
s, c, i, allText := []byte(html), context{}, 0, true
// Using the transition funcs helps us avoid mangling
// `<div title="1>2">` or `I <3 Ponies!`.