package main
import (
"fmt"
"github.com/freehaha/ignores"
"os"
"path/filepath"
)
var ig *ignores.Ignore
func main() {
ig, _ = ignores.New(".ignore")
filepath.Walk(".", walkFunc)
}
func walkFunc(path string, info os.FileInfo, err error) error {
ignore, err := ig.Match(path)
if err != nil {
fmt.Printf("err: %s\n", err)
}
if ignore {
if info.IsDir() {
fmt.Printf("ignored: %s\n", path)
return filepath.SkipDir
}
fmt.Printf("ignored: %s\n", path)
return nil
}
fmt.Printf("path: %s\n", path)
return nil
}
-
Notifications
You must be signed in to change notification settings - Fork 0
freehaha/ignores
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published