Skip to content

Commit 091414b

Browse files
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 <[email protected]> Trust: Emmanuel Odeke <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Emmanuel Odeke <[email protected]> Reviewed-by: Marco Gazerro <[email protected]>
1 parent 9b55088 commit 091414b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/io/fs/walk.go

+4-9
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ var SkipDir = errors.New("skip this directory")
1717
// WalkDirFunc is the type of the function called by WalkDir to visit
1818
// each file or directory.
1919
//
20-
// The path argument contains the argument to Walk as a prefix.
21-
// That is, if Walk is called with root argument "dir" and finds a file
20+
// The path argument contains the argument to WalkDir as a prefix.
21+
// That is, if WalkDir is called with root argument "dir" and finds a file
2222
// named "a" in that directory, the walk function will be called with
2323
// argument "dir/a".
2424
//
25-
// The directory and file are joined with Join, which may clean the
26-
// directory name: if Walk is called with the root argument "x/../dir"
27-
// and finds a file named "a" in that directory, the walk function will
28-
// be called with argument "dir/a", not "x/../dir/a".
29-
//
3025
// The d argument is the fs.DirEntry for the named path.
3126
//
3227
// The error result returned by the function controls how WalkDir
@@ -42,9 +37,9 @@ var SkipDir = errors.New("skip this directory")
4237
//
4338
// WalkDir calls the function with a non-nil err argument in two cases.
4439
//
45-
// First, if the initial os.Lstat on the root directory fails, WalkDir
40+
// First, if the initial fs.Stat on the root directory fails, WalkDir
4641
// calls the function with path set to root, d set to nil, and err set to
47-
// the error from os.Lstat.
42+
// the error from fs.Stat.
4843
//
4944
// Second, if a directory's ReadDir method fails, WalkDir calls the
5045
// function with path set to the directory's path, d set to an

0 commit comments

Comments
 (0)