I'm writing a GoLang app using Go 1.7rc1.
now I want to find all go files in a specific path. besides that I want not to walk on some directories.. for example.. hidden directories like .git
.
is there a way to provide Walk()
with some rules ? or.. is there a diferent libraries that provide these capabilities ?
for now this is my code:
func visit(path string, f os.FileInfo, err error) error {
fmt.Printf("Visited: %s
", path)
return nil
}
func main() {
filepath.Walk(path,visit)
}
any information regarding the issue would be greatly appreciated. thanks!