Skip to content

Commit ca03d44

Browse files
authored
Merge pull request #398 from q384566678/windows-check
validate: increase the validation of windows fields
2 parents a241307 + 2535857 commit ca03d44

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

validate/validate.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,11 @@ func (v *Validator) CheckPlatform() (msgs []string) {
424424
}
425425
}
426426

427-
if v.platform != "windows" {
427+
if v.platform == "windows" {
428+
if v.spec.Windows == nil {
429+
msgs = append(msgs, "'windows' MUST be set when platform is `windows`")
430+
}
431+
} else {
428432
if v.spec.Windows != nil {
429433
msgs = append(msgs, fmt.Sprintf("'windows' MUST NOT be set when target platform is %q", v.platform))
430434
}

0 commit comments

Comments
 (0)