From: Tobias Klauser Date: Sat, 13 Mar 2021 17:00:17 +0000 (+0100) Subject: io/fs: use testing.T.TempDir in TestWalkDir X-Git-Tag: go1.17beta1~1141 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1767d2cc2fed70e4f195474677f72712eaf28c9e;p=gostls13.git io/fs: use testing.T.TempDir in TestWalkDir Change-Id: I805ad51332e4efe27d47f6c6e3b0af945e0d4aa0 Reviewed-on: https://go-review.googlesource.com/c/go/+/301489 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Emmanuel Odeke --- diff --git a/src/io/fs/walk_test.go b/src/io/fs/walk_test.go index ebc4e50fb3..5e127e71cd 100644 --- a/src/io/fs/walk_test.go +++ b/src/io/fs/walk_test.go @@ -6,7 +6,6 @@ package fs_test import ( . "io/fs" - "io/ioutil" "os" pathpkg "path" "testing" @@ -96,11 +95,7 @@ func mark(entry DirEntry, err error, errors *[]error, clear bool) error { } func TestWalkDir(t *testing.T) { - tmpDir, err := ioutil.TempDir("", "TestWalk") - if err != nil { - t.Fatal("creating temp dir:", err) - } - defer os.RemoveAll(tmpDir) + tmpDir := t.TempDir() origDir, err := os.Getwd() if err != nil {