Commit 1e65616e authored by Ian Lance Taylor's avatar Ian Lance Taylor

testing: style change: omit unnecessary new

This was brought to my attention because a user thought that because
the file was named "example.go" it served as an example of good coding
practice.  It's not an example, of course, but may as well use a more
idiomatic style anyhow.

Change-Id: I7aa720f603f09f7d597fb7536dbf46ef09144e28
Reviewed-on: https://go-review.googlesource.com/1902Reviewed-by: 's avatarMinux Ma <minux@golang.org>
parent 6ceb6044
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment