Skip to content
/ xignore Public

A golang package for pattern matching of file paths. Like gitignore, dockerignore chefignore.

License

Notifications You must be signed in to change notification settings

zealic/xignore

Repository files navigation

Build Status Appveyor Status GoDoc GitHub release

xignore

A golang package for pattern matching of file paths. Like gitignore, dockerignore chefignore.

Requirements

  • Golang ≥ 1.11

Use

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)

LICENSE

MIT

Reference

About

A golang package for pattern matching of file paths. Like gitignore, dockerignore chefignore.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published