glob

package
v0.13.8-0...-a8de8dd Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 8 Imported by: 0

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

func (w *Walker) AddExclude(pattern string) error

AddExclude expands braces in the given pattern and adds each expanded pattern to the exclude tree.

func (*Walker) AddInclude

func (w *Walker) AddInclude(pattern string) error

AddInclude expands braces in the given pattern and adds each expanded pattern to the include tree.

func (*Walker) Matches

func (w *Walker) Matches(fp string) bool

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.

Jump to

Keyboard shortcuts

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