We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 10bc51a + 40c4e14 commit a3f192eCopy full SHA for a3f192e
3 files changed
join.go
join_go120.go
@@ -5,4 +5,16 @@ package errors
5
6
import "errors"
7
8
-var Join = errors.Join
+// Join returns an error that wraps the given errors.
9
+// Any nil error values are discarded.
10
+// Join returns nil if every value in errs is nil.
11
+// The error formats as the concatenation of the strings obtained
12
+// by calling the Error method of each element of errs, with a newline
13
+// between each string.
14
+//
15
+// A non-nil error returned by Join implements the Unwrap() []error method.
16
17
+// Available only for go 1.20 or superior.
18
+func Join(errs ...error) error {
19
+ return errors.Join(errs...)
20
+}
join_test.go join_go120_test.gojoin_test.go renamed to join_go120_test.go
@@ -1,3 +1,6 @@
1
+//go:build go1.20
2
+// +build go1.20
3
+
4
package errors_test
import (
0 commit comments