diff --git a/src/testing/example.go b/src/testing/example.go index f5762e4db4a..61339a6465f 100644 --- a/src/testing/example.go +++ b/src/testing/example.go @@ -56,8 +56,8 @@ func runExample(eg InternalExample) (ok bool) { os.Stdout = w outC := make(chan string) go func() { - buf := new(bytes.Buffer) - _, err := io.Copy(buf, r) + var buf bytes.Buffer + _, err := io.Copy(&buf, r) r.Close() if err != nil { fmt.Fprintf(os.Stderr, "testing: copying pipe: %v\n", err)