func countFiles(fs system.FileSystem, dir string) (count int) { fs.Walk(dir, func(path string, info os.FileInfo, err error) error { count++ return nil }) return }