mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
io/fs: use testing.T.TempDir in TestWalkDir
Change-Id: I805ad51332e4efe27d47f6c6e3b0af945e0d4aa0 Reviewed-on: https://go-review.googlesource.com/c/go/+/301489 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
parent
4bd4dfe96a
commit
1767d2cc2f
1 changed files with 1 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue