Documentation
¶
Overview ¶
Package fsutil provides small, filesystem-shaped helpers shared by skillet tools. The functions take an fs.FS rather than touching the OS directly, so callers inject os.DirFS in production and testing/fstest.MapFS in tests, and the discovery logic stays pure and independently testable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SubdirsContaining ¶
SubdirsContaining returns the immediate subdirectories of dir (within fsys) that directly contain a file named marker, as slash paths joined onto dir. The result is sorted by name, because fs.ReadDir returns entries in order.
It returns an error if dir cannot be read. Pass "." for the root of fsys. This is the single-tree discovery shape (a marker file in each candidate child of one parent directory).
func SubdirsContainingAny ¶
SubdirsContainingAny unions SubdirsContaining across dirs, deduplicating repeated subdirectory paths and preserving order — dirs in the given order, subdirectories sorted within each. A dir that does not exist is skipped, modelling an optional root absent in the current environment; any other read error is returned, so a permission fault is surfaced rather than hidden. This is the multi-root discovery shape (scan several candidate parents at once).
Types ¶
This section is empty.