cmd/seqls/manager.go
func (w *workManager) processSources() {
	var (
		ok   bool
		path string
		seq  *fileseq.FileSequence
	)

	fileopts := w.fileOpts

	inDirs := w.inDirs
	inSeqs := w.inSeqs
	outSeqs := w.outSeqs

	isDone := func() bool {
		return (inDirs == nil && inSeqs == nil)
	}

	for !isDone() {
		select {

		// Directory paths will be scanned for contents
		case path, ok = <-inDirs:
			if !ok {
				inDirs = nil
				continue
			}
			seqs, err := fileseq.FindSequencesOnDisk(path, fileopts...)
			if err != nil {
				fmt.Fprintf(errOut, "%s %q: %s\n", ErrorPath, path, err)
				continue
			}
			outSeqs <- seqs

		// Sequence paths will be scanned for a direct match
		// against the sequence pattern
		case seq, ok = <-inSeqs:
			if !ok {
				inSeqs = nil
				continue
			}

			path, err := seq.Format("{{dir}}{{base}}{{pad}}{{ext}}")
			if err != nil {
				fmt.Fprintf(errOut, "%s %q: Not a valid path\n", ErrorPattern, path)
				continue
			}

			seq, err := fileseq.FindSequenceOnDisk(path)
			if err != nil {
				if !os.IsNotExist(err) {
					fmt.Fprintf(errOut, "%s %q: %s\n", ErrorPattern, path, err)
				}
				continue
			}

			if seq != nil {
				outSeqs <- fileseq.FileSequences{seq}
			}
		}
	}
}
func (w *workManager) processSources() {
	var (
		ok   bool
		path string
		seq  *fileseq.FileSequence
	)

	fileopts := w.fileOpts

	inDirs := w.inDirs
	inSeqs := w.inSeqs
	outSeqs := w.outSeqs

	isDone := func() bool {
		return (inDirs == nil && inSeqs == nil)
	}

	for !isDone() {
		select {

		// Directory paths will be scanned for contents
		case path, ok = <-inDirs:
			if !ok {
				inDirs = nil
				continue
			}
			seqs, err := fileseq.FindSequencesOnDisk(path, fileopts...)
			if err != nil {
				fmt.Fprintf(errOut, "%s %q: %s\n", ErrorPath, path, err)
				continue
			}
			outSeqs <- seqs

		// Sequence paths will be scanned for a direct match
		// against the sequence pattern
		case seq, ok = <-inSeqs:
			if !ok {
				inSeqs = nil
				continue
			}

			path, err := seq.Format("{{dir}}{{base}}{{pad}}{{ext}}")
			if err != nil {
				fmt.Fprintf(errOut, "%s %q: Not a valid path\n", ErrorPattern, path)
				continue
			}

			seq, err := fileseq.FindSequenceOnDisk(path)
			if err != nil {
				if !os.IsNotExist(err) {
					fmt.Fprintf(errOut, "%s %q: %s\n", ErrorPattern, path, err)
				}
				continue
			}

			if seq != nil {
				outSeqs <- fileseq.FileSequences{seq}
			}
		}
	}
}
// processSources pulls from input channels, and processes
// them into the output channel until there is no more work