fpath

package
v0.130.1-alpha2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopy added in v0.12.1

func DeepCopy(src string, target string) error

DeepCopy performs a deep copy of src to target, creating all folders leading up to target if necessary.

func ExcludeFiles added in v0.92.0

func ExcludeFiles(testFiles, excludedList []string) []string

ExcludeFiles returns file list which excluding given excluded file list

func FindFiles added in v0.86.0

func FindFiles(rootDir string, sources []string, matchBy MatchPattern) ([]string, error)

FindFiles returns a list of files as identified by the sources. Source pattern interpretation (e.g. regex or glob) is controlled by matchBy.

func Globs

func Globs(patterns []string) []string

Globs returns the names of all files matching the glob patterns. Effectively syntactic sugar for filepath.Glob() to support multiple patterns.

func List

func List(dir string, pattern string) ([]string, error)

List returns a list of files matching the regexp pattern. Unlike filepath.Glob, this method will inspect all subdirectories of dir.

func MatchFiles added in v0.95.0

func MatchFiles(files []string, match []string) []string

MatchFiles returns matched file by specified pattern

func Walk

func Walk(paths []string, pattern string) ([]string, error)

Walk evaluates each glob pattern of paths and walks through each directory. Returns a list of files that match the given regex pattern.

Types

type MatchPattern added in v0.86.0

type MatchPattern string
const (
	FindByRegex        MatchPattern = "regex"
	FindByShellPattern MatchPattern = "shellpattern"
)

Jump to

Keyboard shortcuts

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