blueprint: rename package variable for readability

This commit is contained in:
Florian Schüller 2024-02-20 16:59:46 +01:00 committed by Ondřej Budai
parent fb8634a991
commit 42da3cb143

View file

@ -101,13 +101,13 @@ func (b *Blueprint) Initialize() error {
return fmt.Errorf("Error hashing passwords: %s", err.Error())
}
for i, p := range b.Packages {
if len(p.Name) == 0 {
for i, pkg := range b.Packages {
if pkg.Name == "" {
var errMsg string
if len(p.Version) == 0 {
if pkg.Version == "" {
errMsg = fmt.Sprintf("Entry #%d has no name.", i+1)
} else {
errMsg = fmt.Sprintf("Entry #%d has version '%v' but no name.", i+1, p.Version)
errMsg = fmt.Sprintf("Entry #%d has version '%v' but no name.", i+1, pkg.Version)
}
return fmt.Errorf("All package entries need to contain the name of the package. %s", errMsg)
}