Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶
Find returns a Source that walks the tree rooted at root on the configured filesystem and emits the path of every entry that passes the active filters.
Options (each folded into the run's flags):
- FindFs{Fs: fs}: filesystem to walk (default: the OS filesystem)
- FindName(glob): keep entries whose base name matches glob (GNU -name)
- FindType("f"/"d"): keep only files or only directories (GNU -type)
- FindMaxDepth(n): descend at most n levels below the root (GNU -maxdepth)
Types ¶
type FindFs ¶
FindFs injects the filesystem a find run walks. Production omits it and the real OS filesystem is used; tests pass FindFs{Fs: afero.NewMemMapFs()} for hermetic, 100%-coverable runs. This is the dependency-injection seam for the whole module.
type FindMaxDepth ¶
type FindMaxDepth int
FindMaxDepth limits the walk to entries at most n levels below the root (GNU -maxdepth). The root itself is depth 0.
type FindName ¶
type FindName string
FindName filters entries whose base name matches the glob pattern, GNU -name style (filepath.Match). The empty pattern matches every entry.