aboutsummaryrefslogtreecommitdiff
path: root/src/io
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-01-06 16:25:48 -0800
committerIan Lance Taylor <iant@golang.org>2021-01-07 23:38:51 +0000
commit091414b5b7ced2f6ce1cc9d37e12f62c9a00ef0e (patch)
treebfef3b12382e5e4fadb00ec7d71ec79da7a3ca8a /src/io
parent9b55088d6b49fd4bb4832589a1b7e8629de2800c (diff)
downloadgo-091414b5b7ced2f6ce1cc9d37e12f62c9a00ef0e.tar.gz
go-091414b5b7ced2f6ce1cc9d37e12f62c9a00ef0e.zip
io/fs: correct WalkDirFunc documentation
The documentation was copied from filepath.WalkFunc, and the copy was not fully adjusted to the new circumstances. Fixes #43536 Change-Id: I09687c7656e6938ebd9fc1e1643d34be88cf141d Reviewed-on: https://go-review.googlesource.com/c/go/+/282172 Trust: Ian Lance Taylor <iant@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Marco Gazerro <gazerro@open2b.com>
Diffstat (limited to 'src/io')
-rw-r--r--src/io/fs/walk.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/io/fs/walk.go b/src/io/fs/walk.go
index c33ff10729..534876bad3 100644
--- a/src/io/fs/walk.go
+++ b/src/io/fs/walk.go
@@ -17,16 +17,11 @@ var SkipDir = errors.New("skip this directory")
// WalkDirFunc is the type of the function called by WalkDir to visit
// each file or directory.
//
-// The path argument contains the argument to Walk as a prefix.
-// That is, if Walk is called with root argument "dir" and finds a file
+// The path argument contains the argument to WalkDir as a prefix.
+// That is, if WalkDir is called with root argument "dir" and finds a file
// named "a" in that directory, the walk function will be called with
// argument "dir/a".
//
-// The directory and file are joined with Join, which may clean the
-// directory name: if Walk is called with the root argument "x/../dir"
-// and finds a file named "a" in that directory, the walk function will
-// be called with argument "dir/a", not "x/../dir/a".
-//
// The d argument is the fs.DirEntry for the named path.
//
// The error result returned by the function controls how WalkDir
@@ -42,9 +37,9 @@ var SkipDir = errors.New("skip this directory")
//
// WalkDir calls the function with a non-nil err argument in two cases.
//
-// First, if the initial os.Lstat on the root directory fails, WalkDir
+// First, if the initial fs.Stat on the root directory fails, WalkDir
// calls the function with path set to root, d set to nil, and err set to
-// the error from os.Lstat.
+// the error from fs.Stat.
//
// Second, if a directory's ReadDir method fails, WalkDir calls the
// function with path set to the directory's path, d set to an