Skip to content

Commit 823c014

Browse files
authored
Unwrap for ValidationError (#125)
1 parent 1275a5b commit 823c014

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

errors.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ func (e ValidationError) Error() string {
5353
}
5454
}
5555

56+
// Unwrap gives errors.Is and errors.As access to the inner error.
57+
func (e *ValidationError) Unwrap() error {
58+
return e.Inner
59+
}
60+
5661
// No errors
5762
func (e *ValidationError) valid() bool {
5863
return e.Errors == 0

0 commit comments

Comments
 (0)