Skip to content
lukasholzerPublic

About

Glob matching library for golang supporting globstar and ignore files according to .gitignore spec

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

glob

Main codecov

Usage

The most simple form would be by just providing a glob pattern

files, err := glob.Glob(glob.Pattern("**/*.txt"))

You can pass additionally to a pattern multiple options like IgnoreFiles. The Ignore files will parse the provided files according to the Git Ignore Spec and will ignore the directories or files.

files, err := glob.Glob(glob.Pattern("**/*"), glob.IgnoreFile(".gitignore"))

The Ign

Advanced configuration use case:

files, err := glob.Glob(&glob.Options{
  Patterns:       []string{"**/*.txt"},
  CWD:            "/some/abs/path",
  IgnorePatterns: []string{"node_modules", "other/*.file"},
})

Installation

go get -u github.com/lukasholzer/go-glob

About

Glob matching library for golang supporting globstar and ignore files according to .gitignore spec

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages