Documentation ¶
Overview ¶
Package fsutil adds ignore support for walk
Index ¶
- func Cwd() string
- func DirExists(path string) bool
- func Exists(path string) bool
- func FileExists(path string) bool
- func Walk(root string, ignores *Ignores, walkFunc WalkFunc) error
- func WriteFile(path string, data []byte) error
- type ExactPattern
- type IgnorePattern
- type Ignores
- func (is *Ignores) AddName(name IgnorePattern)
- func (is *Ignores) AddPath(path IgnorePattern)
- func (is *Ignores) IgnoreName(name string) bool
- func (is *Ignores) IgnorePath(path string) bool
- func (is *Ignores) Len() int
- func (is *Ignores) Patterns() []IgnorePattern
- func (is *Ignores) SetPathPrefix(prefix string)
- type WalkFunc
- type WildcardPattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists check if the path exists and it is a file, returns false regardless of detail error message i.e. it is possible the file exists but current reader doesn't have permission to read
Types ¶
type ExactPattern ¶
type ExactPattern string
func (ExactPattern) ShouldIgnore ¶
func (p ExactPattern) ShouldIgnore(path string) bool
type IgnorePattern ¶
type Ignores ¶
type Ignores struct {
// contains filtered or unexported fields
}
func NewIgnores ¶
func NewIgnores(names []IgnorePattern, paths []IgnorePattern) *Ignores
func (*Ignores) AddName ¶
func (is *Ignores) AddName(name IgnorePattern)
func (*Ignores) AddPath ¶
func (is *Ignores) AddPath(path IgnorePattern)
func (*Ignores) IgnoreName ¶
func (*Ignores) IgnorePath ¶
func (*Ignores) Patterns ¶
func (is *Ignores) Patterns() []IgnorePattern
func (*Ignores) SetPathPrefix ¶
type WildcardPattern ¶
type WildcardPattern string
Deprecated it is not implemented yet NOTE: only * and ? is supported * matches any non empty sequence of non-separator character ? matches one non-separator character we are NOT expecting path to have * and ?
func (WildcardPattern) ShouldIgnore ¶
func (p WildcardPattern) ShouldIgnore(path string) bool
Click to show internal directories.
Click to hide internal directories.