Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,20 @@ func GetWafBlockStatusCode(target, mHost string) (isWaf bool, statusCode int, er
return
}

func GetAllFiles(path string) ([]string, error) {
func GetAllFiles(glob string) ([]string, error) {
var files []string

err := filepath.Walk(path, func(filePath string, info os.FileInfo, err error) error {
matches, err := filepath.Glob(glob)
if err != nil {
return nil, err
}
for _, filePath := range matches {
info, err := os.Stat(filePath)
if err != nil {
return err
return nil, err
}
if !info.IsDir() {
files = append(files, filePath)
}
return nil
})
if err != nil {
return nil, err
}

return files, nil
}