aboutsummaryrefslogtreecommitdiff
path: root/src/testing/example.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/example.go')
-rw-r--r--src/testing/example.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testing/example.go b/src/testing/example.go
index f5762e4db4..61339a6465 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)