From c5f1cffca5d488540be9cf89427ff9a982e7cca4 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Thu, 15 Sep 2022 16:15:49 -0700 Subject: [PATCH] main: handle glob errors in getFile (MR 22) ignoring this was proooobably fine, but just in case... --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 3d274b5..eb160a1 100644 --- a/main.go +++ b/main.go @@ -255,7 +255,10 @@ func getFiles(list []string, required bool) (files []string, err error) { func getFile(file string, required bool) (files []string, err error) { // Expand glob expression - expanded, _ := filepath.Glob(file) + expanded, err := filepath.Glob(file) + if err != nil { + return + } if len(expanded) > 0 && expanded[0] != file { for _, path := range expanded { if globFiles, err := getFile(path, required); err != nil {