syscall: replace os.MkdirTemp with T.TempDir

Updates #45402

Change-Id: I573133d6b987e8ac23e3e2018652612af684c755
Reviewed-on: https://go-review.googlesource.com/c/go/+/307990
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
ianwoolf 2021-04-07 22:32:56 +08:00 committed by Ian Lance Taylor
parent fca51ba24a
commit f60aa7a18c
4 changed files with 8 additions and 32 deletions

View file

@ -12,11 +12,7 @@ import (
)
func TestWin32finddata(t *testing.T) {
dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
defer os.RemoveAll(dir)
dir := t.TempDir()
path := filepath.Join(dir, "long_name.and_extension")
f, err := os.Create(path)