From: Emil Hessman Date: Sat, 22 Dec 2012 18:41:01 +0000 (-0500) Subject: testing: fix example test fd leak X-Git-Tag: go1.1rc2~1549 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4b7c2dfcea6568f4f9c5d9b0aadd205821e6f7d3;p=gostls13.git 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 --- diff --git a/src/pkg/testing/example.go b/src/pkg/testing/example.go index dc97255965..34d4b2bda9 100644 --- a/src/pkg/testing/example.go +++ b/src/pkg/testing/example.go @@ -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)