Documentation ¶
Index ¶
- type Glob
- type GlobSet
- func (s *GlobSet) Add(g *Glob)
- func (s *GlobSet) Append(pattern string) error
- func (s *GlobSet) Get() any
- func (s *GlobSet) GetSlice() []string
- func (s *GlobSet) Match(path string) bool
- func (s *GlobSet) Parse(pattern string) error
- func (s *GlobSet) Replace(patterns []string) error
- func (s *GlobSet) Set(pattern string) error
- func (s *GlobSet) String() string
- func (s *GlobSet) Type() string
- type MatchKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Glob ¶
type Glob struct {
// contains filtered or unexported fields
}
A Glob stores a shell filename pattern for matching.
func Parse ¶
Parse parses shell filename pattern and returns a new Glob or an error if the pattern is invalid. Precede the pattern with '!' to negate the Glob.
Parse("*.go") // Matches any string ending with ".go" Parse("!*.go") // Matches any string *not* ending with ".go"
func (*Glob) Set ¶
Sets the Glob's pattern to pattern and exists to implement the flag.Value and pflag.Value interfaces.
type GlobSet ¶
type GlobSet struct {
// contains filtered or unexported fields
}
A GlobSet is an ordered set of Globs. When matching the Glob given later takes precedence.
func NewGlobSet ¶
NewGlobSet returns a new GlobSet.
func (*GlobSet) Append ¶
Append appends pattern to the GlobSet and exists to implement the pflag.SliceValue interface.
func (*GlobSet) GetSlice ¶
GetSlice returns a list of the GlobSet's patterns and exists to implement the pflag.SliceValue interface.
func (*GlobSet) Match ¶
Match returns if the GlobSet matches path. If multiple Globs match path, the glob given later takes precedence.
func (*GlobSet) Replace ¶
Replace replaces all the GlobSet's patterns and exists to implement the pflag.SliceValue interface.
func (*GlobSet) Set ¶
Sets the GlobSet's pattern to pattern, removing any existing patterns and exists to implement the flag.Value and pflag.Value interfaces.