diff --git a/CHANGELOG.md b/CHANGELOG.md index 20756998..be168eda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Changelog +### [13.15.3](https://kaos.sh/ek/13.15.3) + +- `[knf/united]` Return `errors.Errors` instead of `[]error` from `Validate` + ### [13.15.2](https://kaos.sh/ek/13.15.2) - `[color]` Improved named colors support diff --git a/knf/united/united.go b/knf/united/united.go index f5c4eb96..e5e008ad 100644 --- a/knf/united/united.go +++ b/knf/united/united.go @@ -13,6 +13,7 @@ import ( "strings" "time" + "github.com/essentialkaos/ek/v13/errors" "github.com/essentialkaos/ek/v13/knf" "github.com/essentialkaos/ek/v13/knf/value" "github.com/essentialkaos/ek/v13/options" @@ -238,9 +239,9 @@ func GetL(name string, defvals ...[]string) []string { // Validate executes all given validators and // returns slice with validation errors -func Validate(validators knf.Validators) []error { +func Validate(validators knf.Validators) errors.Errors { if global == nil { - return []error{knf.ErrNilConfig} + return errors.Errors{knf.ErrNilConfig} } return validate(validators) @@ -464,8 +465,8 @@ func (c *united) getProp(name string) string { } // validate runs validators over configuration -func validate(validators knf.Validators) []error { - var result []error +func validate(validators knf.Validators) errors.Errors { + var result errors.Errors for _, v := range validators { err := v.Func(global, v.Property, v.Value) diff --git a/version.go b/version.go index 8636aee9..933e7f7a 100644 --- a/version.go +++ b/version.go @@ -8,4 +8,4 @@ package ek // ////////////////////////////////////////////////////////////////////////////////// // // VERSION is current ek package version -const VERSION = "13.15.2" +const VERSION = "13.15.3"