func NameWithExtensions(baseName string, extensions ...string) []string
NameWithExtensions creates a list of names from a base name and a list of extensions.
TODO: find a better name for this function.
func NameWithOptionalExtensions(baseName string, extensions ...string) []string
NameWithOptionalExtensions creates a list of names from a base name and a list of extensions, plus it adds the base name (without any extensions) to the end of the list.
TODO: find a better name for this function.
FileType represents the kind of entries Finder can return.
type FileType int
const ( FileTypeAll FileType = iota FileTypeFile FileTypeDir )
Finder looks for files and directories in an afero.Fs filesystem.
type Finder struct { // Paths represents a list of locations that the [Finder] will search in. // // They are essentially the root directories or starting points for the search. // // Examples: // - home/user // - etc Paths []string // Names are specific entries that the [Finder] will look for within the given Paths. // // It provides the capability to search for entries with depth, // meaning it can target deeper locations within the directory structure. // // It also supports glob syntax (as defined by [filepat.Match]), offering greater flexibility in search patterns. // // Examples: // - config.yaml // - home/*/config.yaml // - home/*/config.* Names []string // Type restricts the kind of entries returned by the [Finder]. // // This parameter helps in differentiating and filtering out files from directories or vice versa. Type FileType }
func (f Finder) Find(fsys afero.Fs) ([]string, error)
Find looks for files and directories in an afero.Fs filesystem.