]> Cypherpunks repositories - gostls13.git/commitdiff
os/signal: replace os.MkdirTemp with T.TempDir
authorManlio Perillo <manlio.perillo@gmail.com>
Sun, 11 Apr 2021 19:06:24 +0000 (21:06 +0200)
committerIan Lance Taylor <iant@golang.org>
Mon, 12 Apr 2021 00:45:40 +0000 (00:45 +0000)
Updates #45402.

Change-Id: I6fe356b51bc825a907f979d9c44432a4d43d1f6e
Reviewed-on: https://go-review.googlesource.com/c/go/+/308996
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/signal/signal_windows_test.go

index 4640428587ba573f1d82a9a1eb7e51f4c7e600e2..9b145515726c7ec820dbe2a0f151a2ce1f6c0981 100644 (file)
@@ -56,11 +56,7 @@ func main() {
        }
 }
 `
-       tmp, err := os.MkdirTemp("", "TestCtrlBreak")
-       if err != nil {
-               t.Fatal("TempDir failed: ", err)
-       }
-       defer os.RemoveAll(tmp)
+       tmp := t.TempDir()
 
        // write ctrlbreak.go
        name := filepath.Join(tmp, "ctlbreak")