Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Glob ¶
type Glob struct {
// contains filtered or unexported fields
}
Glob represents compiled glob pattern.
func Compile ¶
Compile creates Glob for given pattern and strings (if any present after pattern) as separators. The pattern syntax is:
pattern: { term } term: `*` matches any sequence of non-separator characters `**` matches any sequence of characters `?` matches any single non-separator character `[` [ `!` ] { character-range } `]` character class (must be non-empty) `{` pattern-list `}` pattern alternatives c matches character c (c != `*`, `**`, `?`, `\`, `[`, `{`, `}`) `\` c matches character c character-range: c matches character c (c != `\\`, `-`, `]`) `\` c matches character c lo `-` hi matches character c for lo <= c <= hi pattern-list: pattern { `,` pattern } comma-separated (without spaces) patterns extended-glob: `(` { `|` pattern } `)` `@(` { `|` pattern } `)` match and capture one of pipe-separated subpatterns `*(` { `|` pattern } `)` match and capture any number of the pipe-separated subpatterns `+(` { `|` pattern } `)` match and capture one or more of the pipe-separated subpatterns `?(` { `|` pattern } `)` match and capture zero or one of the pipe-separated subpatterns `!(` { `|` pattern } `)` match and capture anything except one of the pipe-separated subpatterns
func MustCompile ¶
MustCompile is the same as Compile, except that if Compile returns error, this will panic
func (*Glob) Capture ¶
Capture returns the list of subexpressions captured while testing the fixture against the compiled pattern
Click to show internal directories.
Click to hide internal directories.