Commit 4b7c2dfc authored by Emil Hessman's avatar Emil Hessman Committed by Russ Cox

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
parent 475f3df4
......@@ -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)
......
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