fastwalk

package
v0.0.0-...-80b6215 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TraverseLink = errors.New("traverse symlink, assuming target is a directory")

TraverseLink is a sentinel error for Walk, similar to filepath.SkipDir.

Functions

func Walk

func Walk(root string, walkFn func(path string, typ os.FileMode) error) error

Walk walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root.

If Walk returns filepath.SkipDir, the directory is skipped.

Unlike filepath.Walk:

  • file stat calls must be done by the user. The only provided metadata is the file type, which does not include any permission bits.
  • multiple goroutines stat the filesystem concurrently. The provided walkFn must be safe for concurrent use.
  • Walk can follow symlinks if walkFn returns the TraverseLink sentinel error. It is the walkFn's responsibility to prevent Walk from going into symlink cycles.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL