A golang package for pattern matching of file paths. Like gitignore, dockerignore chefignore.
- Golang โฅ 1.11
result, _ := xignore.DirMatches("/workspace/my_project", &xignore.MatchesOptions{
Ignorefile: ".gitignore",
Nested: true, // Handle nested ignorefile
})
// ignorefile rules matched files
fmt.Printf("%#v\n", result.MatchedFiles)
// ignorefile rules unmatched files
fmt.Printf("%#v\n", result.UnmatchedFiles)
// ignorefile rules matched dirs
fmt.Printf("%#v\n", result.MatchedDirs)
// ignorefile rules unmatched dirs
fmt.Printf("%#v\n", result.UnmatchedDirs)