forensicanalysis / fsdoublestar

⭐ Double star globbing for io/fs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fsdoublestar

doc

Recursive directory globbing via ** for Go's io/fs.

Example

func main() {
	// get file system for this repository
	wd, _ := os.Getwd()
	fsys := os.DirFS(wd)

	// get all yml files
	matches, _ := fsdoublestar.Glob(fsys, "**/*.yml")

	// print matches
	fmt.Println(matches)
	// Output: [.github/workflows/ci.yml .github/.golangci.yml]
}

Acknowledgement

This repository is based on Bob Matcuk's great doublestar package.

About

⭐ Double star globbing for io/fs

License:MIT License


Languages

Language:Go 100.0%