From 4f4154d42d27c4bac5f2c4b2fa13fcd45c7b8a5e Mon Sep 17 00:00:00 2001 From: Rahul Tarak Date: Sat, 25 Sep 2021 06:28:34 +0530 Subject: [PATCH] Add support for **/*.ext patterns --- filepathx.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/filepathx.go b/filepathx.go index 0129314..347271a 100644 --- a/filepathx.go +++ b/filepathx.go @@ -26,6 +26,11 @@ func Glob(pattern string) ([]string, error) { func (globs Globs) Expand() ([]string, error) { var matches = []string{""} // accumulate here for _, glob := range globs { + if glob == "" { + // If the glob is empty string that means it was ** + // By setting this to . patterns like **/*.txt are supported + glob = "." + } var hits []string var hitMap = map[string]bool{} for _, match := range matches {