aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2026-01-30 15:52:19 -0800
committerGopher Robot <gobot@golang.org>2026-02-02 12:16:54 -0800
commit07f7f8ca5202bdcd39216e25b4a5b2c309ea727f (patch)
treeaaf801edf37a59f4fdc0830e671f4a895029385c /src
parent1c9abbdc8e9032cd613bd147c78b166ebacc8a2e (diff)
downloadgo-07f7f8ca5202bdcd39216e25b4a5b2c309ea727f.tar.xz
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 <thanm@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/covdata/tool_test.go2
-rw-r--r--src/cmd/cover/cover_test.go2
2 files changed, 2 insertions, 2 deletions
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