From: Ian Lance Taylor Date: Thu, 7 Jan 2021 00:25:48 +0000 (-0800) Subject: io/fs: correct WalkDirFunc documentation X-Git-Tag: go1.16rc1~112 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=091414b5b7ced2f6ce1cc9d37e12f62c9a00ef0e;p=gostls13.git 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 Trust: Emmanuel Odeke Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Emmanuel Odeke Reviewed-by: Marco Gazerro --- 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