From: Ian Lance Taylor Date: Fri, 30 Jan 2026 23:52:19 +0000 (-0800) Subject: cmd/cover, cmd/covdata: actually delete temp dirs X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=07f7f8ca5202bdcd39216e25b4a5b2c309ea727f;p=gostls13.git cmd/cover, cmd/covdata: actually delete temp dirs The code was using defer in TestMain, but was also calling os.Exit, which meant that the deferred functions did not run. TestMain does not require calling os.Exit, so stop doing it. Change-Id: I25ca64c36acf65dae3dc3f46e5fa513b9460a8e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/740781 Reviewed-by: Than McIntosh Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Michael Pratt --- diff --git a/src/cmd/covdata/tool_test.go b/src/cmd/covdata/tool_test.go index 730adf4c8e..a9669e7b6a 100644 --- a/src/cmd/covdata/tool_test.go +++ b/src/cmd/covdata/tool_test.go @@ -50,7 +50,7 @@ func TestMain(m *testing.M) { fmt.Fprintf(os.Stderr, "debug: preserving tmpdir %s\n", topTmpdir) } os.Setenv("CMDCOVDATA_TEST_RUN_MAIN", "true") - os.Exit(m.Run()) + m.Run() } var tdmu sync.Mutex diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index 431c0560f6..a1149e9e6e 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -87,7 +87,7 @@ func TestMain(m *testing.M) { fmt.Fprintf(os.Stderr, "debug: preserving tmpdir %s\n", topTmpdir) } os.Setenv("CMDCOVER_TEST_RUN_MAIN", "normal") - os.Exit(m.Run()) + m.Run() } var tdmu sync.Mutex