logginghandler/vendor/github.com/goreleaser/fileglob
Marvin Preuss d095180eb4
All checks were successful
continuous-integration/drone/push Build is passing
build: uses go modules for tool handling
2022-01-14 13:51:56 +01:00
..
.gitignore build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
.golangci.yml build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
.goreleaser.yml build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
doc.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
glob.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
go.mod build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
go.sum build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
LICENSE build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
prefix.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
README.md build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00

GoReleaser Logo

fileglob

A file globbing library.

Release Software License GitHub Actions Codecov branch Go Report Card Go Doc Powered By: GoReleaser

What

fileglob is a glob library that uses gobwas/glob underneath and returns only matching files or direcories, depending on the configuration. Due to this great foundation, fileglob supports:

  • Asterisk wildcards (*)
  • Super-asterisk wildcards (**)
  • Single symbol wildcards (?)
  • Character list matchers with negation and ranges ([abc], [!abc], [a-c])
  • Alternative matchers ({a,b})
  • Nested globbing ({a,[bc]})
  • Escapable wildcards (\{a\}/\* and fileglob.QuoteMeta(pattern))

By also building on top of fs.FS, a range of alternative filesystems as well as custom filesystems are supported.

Why

gobwas/glob is very well implemented: it has a lexer, compiler, and all that, which seems like a better approach than most libraries do: regex.

It doesn't have a Walk method though, and we needed it in a couple of places. So we decided to implement it ourselves, a little bit based on how mattn/go-zglob works.