change linting error messages for null values in arrays

Closes #11627

Signed-off-by: Daniel Strobusch <1847260+dastrobu@users.noreply.github.com>
pull/11628/head
Daniel Strobusch 2 years ago
parent f91b515a25
commit 6a5f240e9a
No known key found for this signature in database
GPG Key ID: 305FC1B7491BC270

@ -54,7 +54,7 @@ type Dependency struct {
// loaded. // loaded.
func (d *Dependency) Validate() error { func (d *Dependency) Validate() error {
if d == nil { if d == nil {
return ValidationError("dependency cannot be an empty list") return ValidationError("dependencies must not contain empty or null nodes")
} }
d.Name = sanitizeString(d.Name) d.Name = sanitizeString(d.Name)
d.Version = sanitizeString(d.Version) d.Version = sanitizeString(d.Version)

@ -35,7 +35,7 @@ type Maintainer struct {
// Validate checks valid data and sanitizes string characters. // Validate checks valid data and sanitizes string characters.
func (m *Maintainer) Validate() error { func (m *Maintainer) Validate() error {
if m == nil { if m == nil {
return ValidationError("maintainer cannot be an empty list") return ValidationError("maintainers must not contain empty or null nodes")
} }
m.Name = sanitizeString(m.Name) m.Name = sanitizeString(m.Name)
m.Email = sanitizeString(m.Email) m.Email = sanitizeString(m.Email)

@ -82,7 +82,7 @@ func TestValidate(t *testing.T) {
nil, nil,
}, },
}, },
ValidationError("dependency cannot be an empty list"), ValidationError("dependencies must not contain empty or null nodes"),
}, },
{ {
&Metadata{ &Metadata{
@ -94,7 +94,7 @@ func TestValidate(t *testing.T) {
nil, nil,
}, },
}, },
ValidationError("maintainer cannot be an empty list"), ValidationError("maintainers must not contain empty or null nodes"),
}, },
{ {
&Metadata{APIVersion: "v2", Name: "test", Version: "1.2.3.4"}, &Metadata{APIVersion: "v2", Name: "test", Version: "1.2.3.4"},

Loading…
Cancel
Save