From: Brad Fitzpatrick Date: Tue, 9 Mar 2021 02:44:27 +0000 (-0800) Subject: cmd/link/internal/ld: deflake TestWindowsIssue36495 X-Git-Tag: go1.17beta1~1228 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=762ef81a5670da99a4b060fd3afe4134c9e82017;p=gostls13.git cmd/link/internal/ld: deflake TestWindowsIssue36495 Over a dozen of the ld tests were missing closes. That was less obvious before CL 299670 started using T.TempDir instead, which fails a test when the tempdir can't be cleaned up (as it can't on Windows when things are still open), insteading of leaving tempdirs around on disk after the test. Most of the missing closes were fixed in CL 299670, but the builders helpfully pointed out that I missed at least this one. Change-Id: I35f695bb7cbfba31e16311c5af965c148f9d7943 Reviewed-on: https://go-review.googlesource.com/c/go/+/299929 Run-TryBot: Brad Fitzpatrick TryBot-Result: Go Bot Reviewed-by: Dan Scales Reviewed-by: Alex Brainman Trust: Dan Scales Trust: Alex Brainman --- diff --git a/src/cmd/link/internal/ld/dwarf_test.go b/src/cmd/link/internal/ld/dwarf_test.go index d16cff911b..f5f2258451 100644 --- a/src/cmd/link/internal/ld/dwarf_test.go +++ b/src/cmd/link/internal/ld/dwarf_test.go @@ -1297,6 +1297,7 @@ func main() { fmt.Println("Hello World") }` f := gobuild(t, dir, prog, NoOpt) + defer f.Close() exe, err := pe.Open(f.path) if err != nil { t.Fatalf("error opening pe file: %v", err)