diff --git a/pkg/addon/addon.go b/pkg/addon/addon.go index 36ea10d88..ebfc28210 100644 --- a/pkg/addon/addon.go +++ b/pkg/addon/addon.go @@ -1626,8 +1626,8 @@ func (h *Installer) renderNotes(addon *InstallPackage) (string, error) { } notesFile := contextFile + "\n" + addon.Notes.Data val := cuecontext.New().CompileString(notesFile) - if val.Err() != nil { - return "", errors.Wrap(err, "build values for NOTES.cue") + if valErr := val.Err(); valErr != nil { + return "", errors.Wrap(valErr, "build values for NOTES.cue") } notes := val.LookupPath(cue.ParsePath(KeyWordNotes)) if !notes.Exists() { diff --git a/pkg/utils/file.go b/pkg/utils/file.go index 8e8e16def..00b3ff1ec 100644 --- a/pkg/utils/file.go +++ b/pkg/utils/file.go @@ -80,7 +80,7 @@ func LoadDataFromPath(ctx context.Context, path string, pathFilter func(string) } bs, e := os.ReadFile(filepath.Clean(path)) if e != nil { - return nil, fmt.Errorf("failed to read file %s: %w", path, err) + return nil, fmt.Errorf("failed to read file %s: %w", path, e) } return []FileData{{Path: path, Data: bs}}, nil }