diff options
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/example.go | 3 | ||||
| -rw-r--r-- | src/testing/testing.go | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/testing/example.go b/src/testing/example.go index b9955500e6..f4beb76f5f 100644 --- a/src/testing/example.go +++ b/src/testing/example.go @@ -5,7 +5,6 @@ package testing import ( - "bytes" "fmt" "io" "os" @@ -72,7 +71,7 @@ func runExample(eg InternalExample) (ok bool) { os.Stdout = w outC := make(chan string) go func() { - var buf bytes.Buffer + var buf strings.Builder _, err := io.Copy(&buf, r) r.Close() if err != nil { 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) |
