Registry /
utility / monochromegane-go-gitignore
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
gitignore
✓ github.com/monochromegane/go-gitignore
Creates a gitignore matcher and checks if a file path is ignored.
package main
import (
"fmt"
"github.com/monochromegane/go-gitignore"
)
func main() {
matcher, err := gitignore.NewGitIgnoreFromReader(".gitignore", nil)
if err != nil {
panic(err)
}
if matcher.Match("some/file.txt", false) {
fmt.Println("File is ignored")
} else {
fmt.Println("File is not ignored")
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20200626010858-205db1a8cc00latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.