mirror of
https://github.com/nabbar/golib.git
synced 2025-10-06 16:27:02 +08:00
Add Validator from github.com/go-playground/validator for LDAP config
Add error function to check if there are any parent error
This commit is contained in:
@@ -92,6 +92,7 @@ type Error interface {
|
||||
|
||||
IsError(e error) bool
|
||||
HasError(err error) bool
|
||||
HasParent() bool
|
||||
|
||||
AddParent(parent ...error)
|
||||
SetParent(parent ...error)
|
||||
@@ -243,6 +244,10 @@ func (e *errors) HasError(err error) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (e *errors) HasParent() bool {
|
||||
return len(e.p) > 0
|
||||
}
|
||||
|
||||
func (e *errors) SetParent(parent ...error) {
|
||||
e.p = make([]Error, 0)
|
||||
e.AddParent(parent...)
|
||||
|
Reference in New Issue
Block a user