diff options
Diffstat (limited to 'src/path/filepath/example_unix_walk_test.go')
| -rw-r--r-- | src/path/filepath/example_unix_walk_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/path/filepath/example_unix_walk_test.go b/src/path/filepath/example_unix_walk_test.go index fa8b8e393b..c8a818fd6e 100644 --- a/src/path/filepath/example_unix_walk_test.go +++ b/src/path/filepath/example_unix_walk_test.go @@ -8,13 +8,13 @@ package filepath_test import ( "fmt" - "io/ioutil" + "io/fs" "os" "path/filepath" ) func prepareTestDirTree(tree string) (string, error) { - tmpDir, err := ioutil.TempDir("", "") + tmpDir, err := os.MkdirTemp("", "") if err != nil { return "", fmt.Errorf("error creating temp directory: %v\n", err) } @@ -40,7 +40,7 @@ func ExampleWalk() { subDirToSkip := "skip" fmt.Println("On Unix:") - err = filepath.Walk(".", func(path string, info os.FileInfo, err error) error { + err = filepath.Walk(".", func(path string, info fs.FileInfo, err error) error { if err != nil { fmt.Printf("prevent panic by handling failure accessing a path %q: %v\n", path, err) return err |
