aboutsummaryrefslogtreecommitdiff
path: root/src/errors/join.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors/join.go')
-rw-r--r--src/errors/join.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/errors/join.go b/src/errors/join.go
index 349fc06ed9..dd50089c29 100644
--- a/src/errors/join.go
+++ b/src/errors/join.go
@@ -26,6 +26,18 @@ func Join(errs ...error) error {
if n == 0 {
return nil
}
+ if n == 1 {
+ for _, err := range errs {
+ if err != nil {
+ if _, ok := err.(interface {
+ Unwrap() []error
+ }); ok {
+ return err
+ }
+ }
+ }
+ }
+
e := &joinError{
errs: make([]error, 0, n),
}