Skip to content

Commit 44474a2

Browse files
committed
feat!: replace WrappedErrors with Unwrap
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
1 parent b94b0f8 commit 44474a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

error.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ func (e *joinedError) Error() string {
2525
len(e.Errors), strings.Join(points, "\n"))
2626
}
2727

28-
// WrappedErrors implements the errwrap.Wrapper interface to make this
29-
// return value more useful with the errwrap and go-multierror libraries.
30-
func (e *joinedError) WrappedErrors() []error {
28+
// Unwrap implements the Unwrap function added in Go 1.20.
29+
func (e *joinedError) Unwrap() []error {
3130
if e == nil {
3231
return nil
3332
}
@@ -40,6 +39,7 @@ func (e *joinedError) WrappedErrors() []error {
4039
return result
4140
}
4241

42+
// TODO: replace with errors.Join when Go 1.20 is minimum version.
4343
func appendErrors(errors []string, err error) []string {
4444
switch e := err.(type) {
4545
case *joinedError:

0 commit comments

Comments
 (0)