filepath.Glob filepath.Match . (.gitignore, zsh) . - :
func glob(dir string, ext string) ([]string, error) {
files := []string{}
err := filepath.Walk(dir, func(path string, f os.FileInfo, err error) error {
if filepath.Ext(path) == ext {
files = append(files, path)
}
return nil
})
return files, err
}
.