Documentation ¶
Index ¶
- type Matcher
- func (m *Matcher) Check(path string) bool
- func (m *Matcher) Compile() error
- func (m *Matcher) Excluded(path string) bool
- func (m *Matcher) HasPrefix(path string) bool
- func (m *Matcher) Included(path string) bool
- func (m *Matcher) MustCompile()
- func (m *Matcher) Some(paths []string) bool
- func (m *Matcher) Walk(files []string) ([]string, map[string]bool, error)deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct { Paths []string Includes []string Excludes []string CompiledIncludes []glob.Glob CompiledExcludes []glob.Glob }
Matcher uses patterns to filter files
func (*Matcher) Check ¶
Check returns true if the string is included and not excluded from the matcher
func (*Matcher) MustCompile ¶
func (m *Matcher) MustCompile()
MustCompile is like Compile but panics if the provided expressions cannot be parsed. It simplifies safe initialization of global variables holding compiled regular expressions.
func (*Matcher) Some ¶
Some uses Check to validate that at least one of the strings in the provided paths match
func (*Matcher) Walk
deprecated
Deprecated: Walk walks the specified files to determine matches against it's declared patterns. If files provided contain directories it will traverse all files and sub directories. The files viewed in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient. Walk does not follow symbolic links.