Skip to content

Commit 2535857

Browse files
author
zhouhao
committed
validate: increase the validation of windows field
Signed-off-by: zhouhao <[email protected]>
1 parent c1b5a02 commit 2535857

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)