Glob pattern matching in Go. See Wikipedia.
TODO
- Simple API.
- Dependency-free.
- Clean and tested code.
- Support for **.
- Walk & find for fs.FS.
See docs or GUIDE.md for more details.
Go version 1.18+
go get github.com/cristalhq/glob
pattern := `foo/**/*.go`
matcher := glob.MustCompile(pattern, '/')
ctx, cancel := context.WithCancel(context.Bacg)
glob.Walk(ctx)
fmt.Printf("For pattern `%s`:\n", pattern)
for _, path := range paths {
	fmt.Printf("%15s %v\n", path, matcher.Match(path))
}See examples: example_test.go.