mirror of
https://github.com/golang/go
synced 2024-11-26 08:38:01 -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) {
|
func TestLookPath(t *testing.T) {
|
||||||
tmp, err := os.MkdirTemp("", "TestLookPath")
|
tmp := t.TempDir()
|
||||||
if err != nil {
|
|
||||||
t.Fatal("TempDir failed: ", err)
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(tmp)
|
|
||||||
|
|
||||||
printpathExe := buildPrintPathExe(t, tmp)
|
printpathExe := buildPrintPathExe(t, tmp)
|
||||||
|
|
||||||
// Run all tests.
|
// Run all tests.
|
||||||
@ -508,12 +503,7 @@ var commandTests = []commandTest{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCommand(t *testing.T) {
|
func TestCommand(t *testing.T) {
|
||||||
tmp, err := os.MkdirTemp("", "TestCommand")
|
tmp := t.TempDir()
|
||||||
if err != nil {
|
|
||||||
t.Fatal("TempDir failed: ", err)
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(tmp)
|
|
||||||
|
|
||||||
printpathExe := buildPrintPathExe(t, tmp)
|
printpathExe := buildPrintPathExe(t, tmp)
|
||||||
|
|
||||||
// Run all tests.
|
// Run all tests.
|
||||||
|
Loading…
Reference in New Issue
Block a user