Skip to content

Commit d09d81a

Browse files
author
Mrunal Patel
authored
Merge pull request #462 from q384566678/checkerr-fix
cmd: modify the err judgment
2 parents e8d5794 + 0ad3376 commit d09d81a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

validate/validate.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ func NewValidatorFromPath(bundlePath string, hostSpecific bool, platform string)
100100
}
101101

102102
// CheckAll checks all parts of runtime bundle
103-
func (v *Validator) CheckAll() (errs error) {
103+
func (v *Validator) CheckAll() error {
104+
var errs *multierror.Error
104105
errs = multierror.Append(errs, v.CheckPlatform())
105106
errs = multierror.Append(errs, v.CheckRoot())
106107
errs = multierror.Append(errs, v.CheckMandatoryFields())
@@ -110,7 +111,7 @@ func (v *Validator) CheckAll() (errs error) {
110111
errs = multierror.Append(errs, v.CheckHooks())
111112
errs = multierror.Append(errs, v.CheckLinux())
112113

113-
return
114+
return errs.ErrorOrNil()
114115
}
115116

116117
// CheckRoot checks status of v.spec.Root

0 commit comments

Comments
 (0)