Fix: call errors.Wrap with a nil value error err (#6739)

Signed-off-by: alingse <alingse@foxmail.com>
This commit is contained in:
alingse
2025-04-22 03:56:57 +05:30
committed by GitHub
parent 27965fb8aa
commit 1588736b4e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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() {
+1 -1
View File
@@ -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
}