From 48db2c01b42d959f2d8fa0c24d853bdb6100cf8a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 26 Mar 2018 06:56:39 +0000 Subject: all: use strings.Builder instead of bytes.Buffer where appropriate I grepped for "bytes.Buffer" and "buf.String" and mostly ignored test files. I skipped a few on purpose and probably missed a few others, but otherwise I think this should be most of them. Updates #18990 Change-Id: I5a6ae4296b87b416d8da02d7bfaf981d8cc14774 Reviewed-on: https://go-review.googlesource.com/102479 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/testing/testing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/testing/testing.go') diff --git a/src/testing/testing.go b/src/testing/testing.go index 27d0de7728..7e936f0fca 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -376,7 +376,7 @@ func (c *common) decorate(s string) string { file = "???" line = 1 } - buf := new(bytes.Buffer) + buf := new(strings.Builder) // Every line is indented at least one tab. buf.WriteByte('\t') fmt.Fprintf(buf, "%s:%d: ", file, line) -- cgit v1.3