]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: replace os.MkdirTemp with T.TempDir
authorManlio Perillo <manlio.perillo@gmail.com>
Wed, 7 Apr 2021 19:56:59 +0000 (21:56 +0200)
committerIan Lance Taylor <iant@golang.org>
Thu, 8 Apr 2021 21:58:35 +0000 (21:58 +0000)
Updates #45402

Change-Id: Idbd8067759d58bc57c52ede4ddccc98ab0ae18fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/308129
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>

src/os/exec/lp_windows_test.go

index 56cb54f800a08f7f58ffdd71273985f8dcceba98..f834ffede03609eb6fdb6de000cea871cf8ec201 100644 (file)
@@ -306,12 +306,7 @@ var lookPathTests = []lookPathTest{
 }
 
 func TestLookPath(t *testing.T) {
-       tmp, err := os.MkdirTemp("", "TestLookPath")
-       if err != nil {
-               t.Fatal("TempDir failed: ", err)
-       }
-       defer os.RemoveAll(tmp)
-
+       tmp := t.TempDir()
        printpathExe := buildPrintPathExe(t, tmp)
 
        // Run all tests.
@@ -508,12 +503,7 @@ var commandTests = []commandTest{
 }
 
 func TestCommand(t *testing.T) {
-       tmp, err := os.MkdirTemp("", "TestCommand")
-       if err != nil {
-               t.Fatal("TempDir failed: ", err)
-       }
-       defer os.RemoveAll(tmp)
-
+       tmp := t.TempDir()
        printpathExe := buildPrintPathExe(t, tmp)
 
        // Run all tests.