Skip to content

Commit d67e739

Browse files
perilloianlancetaylor
authored andcommitted
os/exec: replace os.MkdirTemp with T.TempDir
Updates #45402 Change-Id: Idbd8067759d58bc57c52ede4ddccc98ab0ae18fc Reviewed-on: https://go-review.googlesource.com/c/go/+/308129 Run-TryBot: Dave Cheney <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Trust: Tobias Klauser <[email protected]>
1 parent ec367e5 commit d67e739

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/os/exec/lp_windows_test.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,7 @@ var lookPathTests = []lookPathTest{
306306
}
307307

308308
func TestLookPath(t *testing.T) {
309-
tmp, err := os.MkdirTemp("", "TestLookPath")
310-
if err != nil {
311-
t.Fatal("TempDir failed: ", err)
312-
}
313-
defer os.RemoveAll(tmp)
314-
309+
tmp := t.TempDir()
315310
printpathExe := buildPrintPathExe(t, tmp)
316311

317312
// Run all tests.
@@ -508,12 +503,7 @@ var commandTests = []commandTest{
508503
}
509504

510505
func TestCommand(t *testing.T) {
511-
tmp, err := os.MkdirTemp("", "TestCommand")
512-
if err != nil {
513-
t.Fatal("TempDir failed: ", err)
514-
}
515-
defer os.RemoveAll(tmp)
516-
506+
tmp := t.TempDir()
517507
printpathExe := buildPrintPathExe(t, tmp)
518508

519509
// Run all tests.

0 commit comments

Comments
 (0)