Unwrap for ValidationError (#125)

This commit is contained in:
Kevin de Berk 2021-11-15 15:25:32 +01:00 committed by GitHub
parent 1275a5b909
commit 823c014036
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -53,6 +53,11 @@ func (e ValidationError) Error() string {
} }
} }
// Unwrap gives errors.Is and errors.As access to the inner error.
func (e *ValidationError) Unwrap() error {
return e.Inner
}
// No errors // No errors
func (e *ValidationError) valid() bool { func (e *ValidationError) valid() bool {
return e.Errors == 0 return e.Errors == 0