Skip to content

Commit 199db05

Browse files
committed
ee: add Join for go 1.20
1 parent 315007d commit 199db05

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ee/go120.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//go:build go1.20
2+
// +build go1.20
3+
4+
package ee
5+
6+
import (
7+
stderrors "errors"
8+
)
9+
10+
// Join returns an error that wraps the given errors.
11+
// Any nil error values are discarded.
12+
// Join returns nil if every value in errs is nil.
13+
// The error formats as the concatenation of the strings obtained
14+
// by calling the Error method of each element of errs, with a newline
15+
// between each string.
16+
//
17+
// A non-nil error returned by Join implements the Unwrap() []error method.
18+
func Join(errs ...error) error {
19+
return stderrors.Join(errs...)
20+
}

0 commit comments

Comments
 (0)