find

package
v2.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package find is used to find files that match the provided find pattern or CSV file. It also filters out any files that match the exclude pattern (if any)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(
	ctx context.Context,
	conf *config.Config,
) (matches file.Changes, err error)

Find returns a collection of files and directories that match the search pattern or explicitly included as command-line arguments.

Types

type ExcludeFilter added in v2.2.3

type ExcludeFilter struct{}

ExcludeFilter excludes files that match the exclusion regex.

func (ExcludeFilter) Skip added in v2.2.3

func (f ExcludeFilter) Skip(conf *config.Config, match *file.Change) bool

type Filter added in v2.2.3

type Filter interface {
	// Skip returns true if the match should be excluded from renaming.
	Skip(conf *config.Config, match *file.Change) bool
}

Filter defines the interface for all file discovery filters.

type Filters added in v2.2.3

type Filters []Filter

Filters manages a collection of filters.

func NewFilters added in v2.2.3

func NewFilters(_ *config.Config) Filters

NewFilters creates a new collection of filters based on the configuration.

func (Filters) Skip added in v2.2.3

func (f Filters) Skip(conf *config.Config, match *file.Change) bool

Skip runs the match through all registered filters. It returns true if any filter decides to skip the match.

type IncludeDirFilter added in v2.2.3

type IncludeDirFilter struct{}

IncludeDirFilter excludes directories unless explicitly included.

func (IncludeDirFilter) Skip added in v2.2.3

func (f IncludeDirFilter) Skip(conf *config.Config, match *file.Change) bool

type IncludeRegexFilter added in v2.2.3

type IncludeRegexFilter struct{}

IncludeRegexFilter excludes files that do not match the inclusion regex.

func (IncludeRegexFilter) Skip added in v2.2.3

func (f IncludeRegexFilter) Skip(conf *config.Config, match *file.Change) bool

type OnlyDirFilter added in v2.2.3

type OnlyDirFilter struct{}

OnlyDirFilter excludes non-directory files if OnlyDir is set.

func (OnlyDirFilter) Skip added in v2.2.3

func (f OnlyDirFilter) Skip(conf *config.Config, match *file.Change) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL