From a00958aac6b4e39248b2604bb1224cc0dec015ae Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Fri, 21 Jun 2013 11:13:14 +1000 Subject: all: avoid leaking fds during tests trivial: it is not a serious problem to leak a fd in a short lived process, but it was obscuring my investigation of issue 5593. R=golang-dev, iant, bradfitz CC=golang-dev https://golang.org/cl/10391043 --- src/pkg/debug/elf/file_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pkg/debug') diff --git a/src/pkg/debug/elf/file_test.go b/src/pkg/debug/elf/file_test.go index f9aa7265af..38b5f9e707 100644 --- a/src/pkg/debug/elf/file_test.go +++ b/src/pkg/debug/elf/file_test.go @@ -166,6 +166,7 @@ func TestOpen(t *testing.T) { } else { f, err = Open(tt.file) } + defer f.Close() if err != nil { t.Errorf("cannot open file %s: %v", tt.file, err) continue -- cgit v1.3