]> Cypherpunks repositories - gostls13.git/commitdiff
io/fs: correct WalkDirFunc documentation
authorIan Lance Taylor <iant@golang.org>
Thu, 7 Jan 2021 00:25:48 +0000 (16:25 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 7 Jan 2021 23:38:51 +0000 (23:38 +0000)
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>
src/io/fs/walk.go

index c33ff107294676d50121f0af78221adab2d991c7..534876bad342051d31bed119f35d45a707ba3a5f 100644 (file)
@@ -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