]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/addr2line: use t.TempDir
authorKir Kolyshkin <kolyshkin@gmail.com>
Thu, 5 Sep 2024 00:34:29 +0000 (17:34 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 6 Sep 2024 13:23:48 +0000 (13:23 +0000)
Change-Id: I62f1c51be89e9c2f22cc7b0b2e554ffa3da907ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/611038
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/addr2line/addr2line_test.go

index 5393eb7fe0103ce82ee57536b9de3cc6e9ff4ecf..22a30b3de08b18bfafa18709d9b6d3e9db868dd3 100644 (file)
@@ -102,11 +102,7 @@ func testAddr2Line(t *testing.T, dbgExePath, addr string) {
 func TestAddr2Line(t *testing.T) {
        testenv.MustHaveGoBuild(t)
 
-       tmpDir, err := os.MkdirTemp("", "TestAddr2Line")
-       if err != nil {
-               t.Fatal("TempDir failed: ", err)
-       }
-       defer os.RemoveAll(tmpDir)
+       tmpDir := t.TempDir()
 
        // Build copy of test binary with debug symbols,
        // since the one running now may not have them.