func()

in pkg/reporeader/readers/localfsreader.go [32:55]


func (l *LocalFileFinder) walkFunc(path string, info os.DirEntry, err error) error {
	if err != nil {
		return err
	}

	// Skip directories that are too deep
	if info.IsDir() && strings.Count(path, string(os.PathSeparator)) > l.MaxDepth {
		fmt.Println("skip", path)
		return fs.SkipDir
	}

	if info.IsDir() {
		return nil
	}

	for _, pattern := range l.Patterns {
		if matched, err := filepath.Match(pattern, filepath.Base(path)); err != nil {
			return err
		} else if matched {
			l.FoundFiles = append(l.FoundFiles, path)
		}
	}
	return nil
}