Skip to content

Commit b614ed4

Browse files
committed
cmd/go: clean up x.exe properly in TestImportMain
More generally I'm concerned about these tests using $GOROOT/src/cmd/go as scratch space, especially combined wtih tg.parallel() - it's easy to believe some other test might inadvertently also try to write x.exe about the same time. This CL only solves the "didn't clean up x.exe" problem and leaves for another day the "probably shouldn't write to cmd/go at all" problem. Fixes #22266. Change-Id: I651534d70e2d360138e0373fb4a316081872550b Reviewed-on: https://go-review.googlesource.com/71410 Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent ddc64de commit b614ed4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/go/go_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ func TestImportMain(t *testing.T) {
29872987
func TestFoo(t *testing.T) {}
29882988
`)
29892989
tg.setenv("GOPATH", tg.path("."))
2990-
tg.creatingTemp("x")
2990+
tg.creatingTemp("x" + exeSuffix)
29912991
tg.run("build", "x")
29922992
tg.run("test", "x")
29932993

0 commit comments

Comments
 (0)