diff --git a/controller/generic_controller.go b/controller/generic_controller.go index 93b455d1..0f9cd9d3 100644 --- a/controller/generic_controller.go +++ b/controller/generic_controller.go @@ -215,7 +215,7 @@ func (g *genericController) syncHandler(s string) (err error) { }) } } - err = types.NewErrors(errs) + err = types.NewErrors(errs...) return } diff --git a/types/schemas.go b/types/schemas.go index 53e6058f..2e9cb314 100644 --- a/types/schemas.go +++ b/types/schemas.go @@ -57,7 +57,7 @@ func (s *Schemas) Init(initFunc SchemasInitFunc) *Schemas { } func (s *Schemas) Err() error { - return NewErrors(s.errors) + return NewErrors(s.errors...) } func (s *Schemas) AddSchemas(schema *Schemas) *Schemas { @@ -343,7 +343,7 @@ type multiErrors struct { errors []error } -func NewErrors(errors []error) error { +func NewErrors(errors ...error) error { if len(errors) == 0 { return nil } else if len(errors) == 1 {