From 4b7c2dfcea6568f4f9c5d9b0aadd205821e6f7d3 Mon Sep 17 00:00:00 2001 From: Emil Hessman Date: Sat, 22 Dec 2012 13:41:01 -0500 Subject: [PATCH] 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 --- src/pkg/testing/example.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkg/testing/example.go b/src/pkg/testing/example.go index dc97255965e..34d4b2bda99 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)