From 0ad3376daafec2cc02ed630bc9621d2552a3ae18 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Tue, 5 Sep 2017 16:54:56 +0800 Subject: [PATCH] cmd: modify the err judgment Signed-off-by: zhouhao --- validate/validate.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/validate/validate.go b/validate/validate.go index 0d62a53ef..f628be354 100644 --- a/validate/validate.go +++ b/validate/validate.go @@ -100,7 +100,8 @@ func NewValidatorFromPath(bundlePath string, hostSpecific bool, platform string) } // CheckAll checks all parts of runtime bundle -func (v *Validator) CheckAll() (errs error) { +func (v *Validator) CheckAll() error { + var errs *multierror.Error errs = multierror.Append(errs, v.CheckPlatform()) errs = multierror.Append(errs, v.CheckRoot()) errs = multierror.Append(errs, v.CheckMandatoryFields()) @@ -110,7 +111,7 @@ func (v *Validator) CheckAll() (errs error) { errs = multierror.Append(errs, v.CheckHooks()) errs = multierror.Append(errs, v.CheckLinux()) - return + return errs.ErrorOrNil() } // CheckRoot checks status of v.spec.Root