From f7f42bc2d485def44cfaa3bb28f69d2d655d2be4 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sun, 12 Mar 2023 20:18:51 -0700 Subject: [PATCH] filelist/modules: handle errors from filepath.Walk --- internal/filelist/modules/modules.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/filelist/modules/modules.go b/internal/filelist/modules/modules.go index 2eab27f..0276f2a 100644 --- a/internal/filelist/modules/modules.go +++ b/internal/filelist/modules/modules.go @@ -126,7 +126,11 @@ func slurpModules(fd io.Reader, modDir string) (*filelist.FileList, error) { } func getModulesInDir(modPath string) (files []string, err error) { - err = filepath.Walk(modPath, func(path string, f os.FileInfo, err error) error { + err = filepath.Walk(modPath, func(path string, _ os.FileInfo, err error) error { + if err != nil { + // Unable to walk path + return err + } if filepath.Ext(path) != ".ko" && filepath.Ext(path) != ".xz" { return nil }