aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-07-07 13:49:21 -0400
committerRuss Cox <rsc@golang.org>2020-10-20 02:32:42 +0000
commit7bb721b9384bdd196befeaed593b185f7f2a5589 (patch)
tree882f21fc2e1fbba6fb11100e4fd8efc5f973a44d /src/path/filepath/path.go
parentd4da735091986868015369e01c63794af9cc9b84 (diff)
downloadgo-7bb721b9384bdd196befeaed593b185f7f2a5589.tar.xz
all: update references to symbols moved from os to io/fs
The old os references are still valid, but update our code to reflect best practices and get used to the new locations. Code compiled with the bootstrap toolchain (cmd/asm, cmd/dist, cmd/compile, debug/elf) must remain Go 1.4-compatible and is excluded. For #41190. Change-Id: I8f9526977867c10a221e2f392f78d7dec073f1bd Reviewed-on: https://go-review.googlesource.com/c/go/+/243907 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/path/filepath/path.go')
-rw-r--r--src/path/filepath/path.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go
index 26f1833189..dffd27db14 100644
--- a/src/path/filepath/path.go
+++ b/src/path/filepath/path.go
@@ -13,6 +13,7 @@ package filepath
import (
"errors"
+ "io/fs"
"os"
"sort"
"strings"
@@ -339,7 +340,7 @@ var SkipDir = errors.New("skip this directory")
// visited by Walk. The path argument contains the argument to Walk as a
// prefix; that is, if Walk is called with "dir", which is a directory
// containing the file "a", the walk function will be called with argument
-// "dir/a". The info argument is the os.FileInfo for the named path.
+// "dir/a". The info argument is the fs.FileInfo for the named path.
//
// If there was a problem walking to the file or directory named by path, the
// incoming error will describe the problem and the function can decide how
@@ -350,12 +351,12 @@ var SkipDir = errors.New("skip this directory")
// Walk skips the directory's contents entirely. If the function returns SkipDir
// when invoked on a non-directory file, Walk skips the remaining files in the
// containing directory.
-type WalkFunc func(path string, info os.FileInfo, err error) error
+type WalkFunc func(path string, info fs.FileInfo, err error) error
var lstat = os.Lstat // for testing
// walk recursively descends path, calling walkFn.
-func walk(path string, info os.FileInfo, walkFn WalkFunc) error {
+func walk(path string, info fs.FileInfo, walkFn WalkFunc) error {
if !info.IsDir() {
return walkFn(path, info, nil)
}