blueprint: improve error message on missing name

the error should not infer that a version is mandatory.
Also the error message is now explicitly checked
This commit is contained in:
Florian Schüller 2024-02-20 14:27:31 +01:00 committed by Ondřej Budai
parent e31ec13c87
commit fb8634a991
2 changed files with 16 additions and 11 deletions

View file

@ -105,7 +105,7 @@ func (b *Blueprint) Initialize() error {
if len(p.Name) == 0 {
var errMsg string
if len(p.Version) == 0 {
errMsg = fmt.Sprintf("Entry #%d has neither version nor name.", i+1)
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)
}