1
0
mirror of https://github.com/golang/go synced 2024-09-24 05:20:13 -06: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:
Manlio Perillo 2021-04-07 21:56:59 +02:00 committed by Ian Lance Taylor
parent ec367e5b05
commit d67e739989

View 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.