mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
a89c3d76ba
commit
ab87db8b46
9 changed files with 20 additions and 19 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue