We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f2cf3c commit bb2228cCopy full SHA for bb2228c
internal/xerrors/join.go
@@ -7,11 +7,20 @@ import (
7
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xstring"
8
)
9
10
-func Join(errs ...error) *joinError {
11
- return &joinError{
12
- errs: xslices.Filter(errs, func(err error) bool {
13
- return err != nil
14
- }),
+func Join(errs ...error) error {
+ errs = xslices.Filter(errs, func(err error) bool {
+ return err != nil
+ })
+
15
+ switch len(errs) {
16
+ case 0:
17
+ return nil
18
+ case 1:
19
+ return errs[0]
20
+ default:
21
+ return &joinError{
22
+ errs: errs,
23
+ }
24
}
25
26
0 commit comments