Documentation ¶
Overview ¶
Package fsutil provides helpers and utilities for working with Files and FileSystems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GlobMatcher ¶
GlobMatcher holds patterns for inclusion and exclusion of file paths. Directories don't need to be included but can be excluded.
func NewGlobMatcher ¶
func NewGlobMatcher(includes, excludes []string) *GlobMatcher
NewGlobMatcher constructs a new GlobMatcher with specified include and exclude patterns.
func (GlobMatcher) Excluded ¶
func (m GlobMatcher) Excluded(target string) bool
Excluded checks if a given target path matches any of the exclude patterns.
func (GlobMatcher) Included ¶
func (m GlobMatcher) Included(target string) bool
Included checks if a given target path matches any of the include patterns. A matcher with no include patterns implicitly includes all targets.
func (GlobMatcher) Match ¶
func (m GlobMatcher) Match(target string) bool
Match determines if a target path is included and not excluded by the matcher's patterns.
func (GlobMatcher) WalkFS ¶
WalkFS traverses the file system starting from the root, applying the matcher's patterns to each file and directory. Matched files are processed by the provided walkFunc. The function accumulates errors encountered during traversal and processing, returning them as a single error.