2023-01-27 15:04:58 +00:00
|
|
|
package fileset
|
|
|
|
|
|
|
|
// Ignorer is the interface for what determines if a path
|
|
|
|
// in the [FileSet] must be ignored or not.
|
|
|
|
type Ignorer interface {
|
2023-01-31 17:34:36 +00:00
|
|
|
IgnoreFile(path string) (bool, error)
|
|
|
|
IgnoreDirectory(path string) (bool, error)
|
2023-01-27 15:04:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// nopIgnorer implements an [Ignorer] that doesn't ignore anything.
|
|
|
|
type nopIgnorer struct{}
|
|
|
|
|
2023-01-31 17:34:36 +00:00
|
|
|
func (nopIgnorer) IgnoreFile(path string) (bool, error) {
|
|
|
|
return false, nil
|
2023-01-27 15:04:58 +00:00
|
|
|
}
|
|
|
|
|
2023-01-31 17:34:36 +00:00
|
|
|
func (nopIgnorer) IgnoreDirectory(path string) (bool, error) {
|
|
|
|
return false, nil
|
2023-01-27 15:04:58 +00:00
|
|
|
}
|