mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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/1902 Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
parent
6ceb60444d
commit
1e65616e1a
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue