Skip to content

Commit 9fd1d14

Browse files
committed
simplify a bit areAllOfTheSameType
1 parent b2e3478 commit 9fd1d14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wrap.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ func areAllOfTheSameType(errs ...error) bool {
107107
return false
108108
}
109109

110-
if errorType != nil && errorType != typedError.Type() {
110+
if errorType == nil {
111+
errorType = typedError.Type()
112+
} else if errorType != typedError.Type() {
111113
return false
112114
}
113-
errorType = typedError.Type()
114115
}
115116

116117
return true

0 commit comments

Comments
 (0)