From 42899f6c8317b68199d46a86c1cc0b15b1976bb8 Mon Sep 17 00:00:00 2001 From: Cameron Rozean Date: Fri, 15 Sep 2023 08:24:55 -0700 Subject: [PATCH] fix unchecked err --- tools/eksDistroBuildToolingOpsTools/pkg/git/gogitClient.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/eksDistroBuildToolingOpsTools/pkg/git/gogitClient.go b/tools/eksDistroBuildToolingOpsTools/pkg/git/gogitClient.go index 2625a99e1..b8e0de4e5 100644 --- a/tools/eksDistroBuildToolingOpsTools/pkg/git/gogitClient.go +++ b/tools/eksDistroBuildToolingOpsTools/pkg/git/gogitClient.go @@ -549,7 +549,7 @@ func (g *GogitClient) ReadFiles(foldername string) (map[string]string, error) { } files := make(map[string]string) - tree.Files().ForEach(func(f *object.File) error { + err = tree.Files().ForEach(func(f *object.File) error { if(strings.Contains(f.Name, foldername)) { p, err := f.Contents() if err != nil { @@ -559,6 +559,9 @@ func (g *GogitClient) ReadFiles(foldername string) (map[string]string, error) { } return nil }) + if err != nil { + return nil, fmt.Errorf("reading files from folder: %s, %v", foldername, err) + } return files, nil }