mirror of
https://github.com/golang/go.git
synced 2025-11-08 20:51:02 +00: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
1 changed files with 1 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue