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 23096a3 commit 648367eCopy full SHA for 648367e
join.go
@@ -37,6 +37,8 @@ type ErrorJoin interface {
37
error
38
Append(error)
39
Unwrap() []error
40
+ Len() int
41
+ ToError() error
42
}
43
44
type withJoin struct {
@@ -95,3 +97,14 @@ func (w *withJoin) Format(s fmt.State, verb rune) {
95
97
96
98
99
100
+
101
+func (w *withJoin) Len() int {
102
+ return len(w.errs)
103
+}
104
105
+func (w *withJoin) ToError() error {
106
+ if len(w.errs) == 0 {
107
+ return nil
108
+ }
109
+ return w
110
0 commit comments