go/internal/gccgoimporter: replace os.MkdirTemp with T.TempDir

Updates #45402

Change-Id: Ie84795ed456883c0558fa9b5e3f2186f5f2c0fd9
Reviewed-on: https://go-review.googlesource.com/c/go/+/309356
Run-TryBot: Ian Lance Taylor <iant@golang.org>
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-13 12:52:35 +02:00 committed by Ian Lance Taylor
parent d1f8104b58
commit de7a87ef06

View file

@ -149,21 +149,11 @@ func TestObjImporter(t *testing.T) {
}
t.Logf("gccgo version %d.%d", major, minor)
tmpdir, err := os.MkdirTemp("", "TestObjImporter")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmpdir)
tmpdir := t.TempDir()
initmap := make(map[*types.Package]InitData)
imp := GetImporter([]string{tmpdir}, initmap)
artmpdir, err := os.MkdirTemp("", "TestObjImporter")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(artmpdir)
artmpdir := t.TempDir()
arinitmap := make(map[*types.Package]InitData)
arimp := GetImporter([]string{artmpdir}, arinitmap)