mirror of
https://github.com/golang/go
synced 2024-11-25 08:07:57 -07:00
testing: fix example test fd leak
Close the read side of the pipe. Fixes #4551. R=rsc CC=golang-dev https://golang.org/cl/6962049
This commit is contained in:
parent
475f3df43f
commit
4b7c2dfcea
@ -50,6 +50,7 @@ func RunExamples(matchString func(pat, str string) (bool, error), examples []Int
|
||||
go func() {
|
||||
buf := new(bytes.Buffer)
|
||||
_, err := io.Copy(buf, r)
|
||||
r.Close()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "testing: copying pipe: %v\n", err)
|
||||
os.Exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user