encoding: use strings.Builder

Change-Id: Ib07699df8ea41fd8d1bca8ad050859fac24623de
Reviewed-on: https://go-review.googlesource.com/c/go/+/428258
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
cuiweixie 2022-09-04 17:44:30 +08:00 committed by Gopher Robot
parent a89c3d76ba
commit ab87db8b46
9 changed files with 20 additions and 19 deletions

View file

@ -894,7 +894,7 @@ func TestEscapeTextInvalidChar(t *testing.T) {
input := []byte("A \x00 terminated string.")
expected := "A \uFFFD terminated string."
buff := new(bytes.Buffer)
buff := new(strings.Builder)
if err := EscapeText(buff, input); err != nil {
t.Fatalf("have %v, want nil", err)
}