Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker holds an include pattern tree and an exclude pattern tree. these trees are used to determine if a file path should be processed.
func NewWalker ¶
func NewWalker() *Walker
NewWalker creates a new walker with empty include and exclude pattern trees.
func (*Walker) AddExclude ¶
AddExclude expands braces in the given pattern and adds each expanded pattern to the exclude tree.
func (*Walker) AddInclude ¶
AddInclude expands braces in the given pattern and adds each expanded pattern to the include tree.
func (*Walker) Walk ¶
func (w *Walker) Walk( ctx context.Context, fs afero.Fs, root string, onFile func(string) error, ) error
Walk traverses the filesystem in parallel starting at root. for each file, it splits the relative path into tokens and calls onFile if the path matches the include tree and does not match the exclude tree. if a directory matches the exclude tree, its subtree is skipped.