filelist/modules: handle errors from filepath.Walk

This commit is contained in:
Clayton Craft
2023-03-12 20:18:51 -07:00
parent c62a1f9ddb
commit f7f42bc2d4

View File

@@ -126,7 +126,11 @@ func slurpModules(fd io.Reader, modDir string) (*filelist.FileList, error) {
} }
func getModulesInDir(modPath string) (files []string, err 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" { if filepath.Ext(path) != ".ko" && filepath.Ext(path) != ".xz" {
return nil return nil
} }