cmd/seqls/manager.go
func (w *workManager) loadRecursive(paths []string) {

	walkFn := func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return nil
		}

		var isDir bool

		if info.IsDir() {
			isDir = true
		} else if info, err = os.Stat(path); err == nil && info.IsDir() {
			isDir = true
		}

		if isDir {

			if !Options.AllFiles {
				// Skip tranversing into hidden dirs
				if len(info.Name()) > 1 && strings.HasPrefix(info.Name(), ".") {
					return walk.SkipDir
				}
			}

			// Add the path to the input channel for sequence scanning
			w.inDirs <- path
		}

		return nil
	}

	dirs, seqs := preparePaths(paths)

	for _, s := range seqs {
		w.inSeqs <- s
	}

	for _, r := range dirs {
		r := r
		if err := walk.Walk(r, walkFn); err != nil {
			if err != walk.SkipDir {
				fmt.Fprintf(errOut, "%s %q: %s\n", ErrorPath, r, err)
			}
		}
	}
}
func (w *workManager) loadRecursive(paths []string) {

	walkFn := func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return nil
		}

		var isDir bool

		if info.IsDir() {
			isDir = true
		} else if info, err = os.Stat(path); err == nil && info.IsDir() {
			isDir = true
		}

		if isDir {

			if !Options.AllFiles {
				// Skip tranversing into hidden dirs
				if len(info.Name()) > 1 && strings.HasPrefix(info.Name(), ".") {
					return walk.SkipDir
				}
			}

			// Add the path to the input channel for sequence scanning
			w.inDirs <- path
		}

		return nil
	}

	dirs, seqs := preparePaths(paths)

	for _, s := range seqs {
		w.inSeqs <- s
	}

	for _, r := range dirs {
		r := r
		if err := walk.Walk(r, walkFn); err != nil {
			if err != walk.SkipDir {
				fmt.Fprintf(errOut, "%s %q: %s\n", ErrorPath, r, err)
			}
		}
	}
}
// Parallel walk the root paths and populate the path
// channel for the worker routines to consume.