Skip to content

Commit

Permalink
Unwrap for ValidationError (golang-jwt#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeberk authored and oxisto committed Feb 21, 2023
1 parent 9bf1412 commit 75cd9bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions errors.go
Expand Up @@ -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
func (e *ValidationError) valid() bool {
return e.Errors == 0
Expand Down

0 comments on commit 75cd9bc

Please sign in to comment.