aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/crash_unix_test.go
diff options
context:
space:
mode:
authorianwoolf <btw515wolf2@gmail.com>2021-04-07 20:16:58 +0800
committerEmmanuel Odeke <emmanuel@orijtech.com>2021-04-08 07:33:58 +0000
commita7e16abb22f1b249d2691b32a5d20206282898f2 (patch)
tree68c912580165de3096390796f15234f4b8c8eae9 /src/runtime/crash_unix_test.go
parent2123dfba651e3522ed039d1b38fde91ededf47a3 (diff)
downloadgo-a7e16abb22f1b249d2691b32a5d20206282898f2.tar.gz
go-a7e16abb22f1b249d2691b32a5d20206282898f2.zip
runtime: replace os.MkdirTemp with T.TempDir
Updates #45402 Change-Id: I3aa82fc2486b4de49b45388bbab24f5ffe558f91 Reviewed-on: https://go-review.googlesource.com/c/go/+/307989 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/runtime/crash_unix_test.go')
-rw-r--r--src/runtime/crash_unix_test.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/runtime/crash_unix_test.go b/src/runtime/crash_unix_test.go
index 341c35ca56..b5cc910ad1 100644
--- a/src/runtime/crash_unix_test.go
+++ b/src/runtime/crash_unix_test.go
@@ -85,11 +85,7 @@ func TestCrashDumpsAllThreads(t *testing.T) {
t.Parallel()
- dir, err := os.MkdirTemp("", "go-build")
- if err != nil {
- t.Fatalf("failed to create temp directory: %v", err)
- }
- defer os.RemoveAll(dir)
+ dir := t.TempDir()
if err := os.WriteFile(filepath.Join(dir, "main.go"), []byte(crashDumpsAllThreadsSource), 0666); err != nil {
t.Fatalf("failed to create Go file: %v", err)