Documentation
¶
Overview ¶
Package pathglob matches slash-separated relative paths against the glob patterns hook matchers and scoped rules share, so one pattern means the same thing in both.
The syntax follows the patterns Claude Code rules, Cursor rules, and GitHub Copilot instructions document:
- `*` matches any run of characters inside one path segment.
- `**` as a whole segment matches zero or more segments, so `**/*.go` matches `main.go` and `cmd/app/main.go`.
- `?` matches one character other than `/`.
- `[abc]`, `[a-z]`, and `[!abc]` or `[^abc]` match one character from, or not from, the set. They never match `/`.
- `{a,b}` matches either alternative, and alternatives may nest.
- `\` makes the next character literal.
A brace group with no comma, such as `{a}`, is literal text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compile ¶
Compile translates pattern into an anchored regular expression.
A pattern with an unclosed `[` or `{`, or a trailing `\`, fails with commerr.ErrValidationFailed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.