mirror of
https://github.com/golang/go
synced 2024-11-23 06:20:07 -07:00
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 <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>
This commit is contained in:
parent
ec367e5b05
commit
d67e739989
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user