diff --git a/src/os/signal/signal_windows_test.go b/src/os/signal/signal_windows_test.go index 4640428587b..9b145515726 100644 --- a/src/os/signal/signal_windows_test.go +++ b/src/os/signal/signal_windows_test.go @@ -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")