2
2
// Use of this source code is governed by a BSD-style
3
3
// license that can be found in the LICENSE file.
4
4
5
- // Package fastwalk provides a faster version of filepath.Walk for file system
5
+ // Package fastwalk provides a faster version of [ filepath.Walk] for file system
6
6
// scanning tools.
7
7
package fastwalk
8
8
@@ -23,31 +23,31 @@ var ErrTraverseLink = errors.New("fastwalk: traverse symlink, assuming target is
23
23
// Child directories will still be traversed.
24
24
var ErrSkipFiles = errors .New ("fastwalk: skip remaining files in directory" )
25
25
26
- // Walk is a faster implementation of filepath.Walk.
26
+ // Walk is a faster implementation of [ filepath.Walk] .
27
27
//
28
- // filepath.Walk's design necessarily calls os.Lstat on each file,
28
+ // [ filepath.Walk] 's design necessarily calls [ os.Lstat] on each file,
29
29
// even if the caller needs less info.
30
30
// Many tools need only the type of each file.
31
31
// On some platforms, this information is provided directly by the readdir
32
32
// system call, avoiding the need to stat each file individually.
33
33
// fastwalk_unix.go contains a fork of the syscall routines.
34
34
//
35
- // See golang.org/issue/16399
35
+ // See golang.org/issue/16399.
36
36
//
37
37
// Walk walks the file tree rooted at root, calling walkFn for
38
38
// each file or directory in the tree, including root.
39
39
//
40
- // If fastWalk returns filepath.SkipDir, the directory is skipped.
40
+ // If Walk returns [ filepath.SkipDir] , the directory is skipped.
41
41
//
42
- // Unlike filepath.Walk:
42
+ // Unlike [ filepath.Walk] :
43
43
// - file stat calls must be done by the user.
44
44
// The only provided metadata is the file type, which does not include
45
45
// any permission bits.
46
46
// - multiple goroutines stat the filesystem concurrently. The provided
47
47
// walkFn must be safe for concurrent use.
48
- // - fastWalk can follow symlinks if walkFn returns the TraverseLink
48
+ // - Walk can follow symlinks if walkFn returns the TraverseLink
49
49
// sentinel error. It is the walkFn's responsibility to prevent
50
- // fastWalk from going into symlink cycles.
50
+ // Walk from going into symlink cycles.
51
51
func Walk (root string , walkFn func (path string , typ os.FileMode ) error ) error {
52
52
// TODO(bradfitz): make numWorkers configurable? We used a
53
53
// minimum of 4 to give the kernel more info about multiple
0 commit comments