Skip to content

Commit cca6feb

Browse files
committed
fix for review
1 parent 5dc93b3 commit cca6feb

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

retry.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ func NotOnErrors(errs ...error) Condition {
7979
// The error passed to the retry conditions will be the result
8080
// of errors.Cause() on the original error from the run function.
8181
func (r *Retry) Conditions(fns ...Condition) *Retry {
82-
for i, fn := range fns {
83-
fn := fn
84-
fns[i] = func(err error) bool {
85-
err = errors.Cause(err)
86-
return fn(err)
87-
}
88-
}
8982
r.appendPostConditions(fns...)
9083
return r
9184
}
@@ -107,6 +100,7 @@ func (r *Retry) preCheck() bool {
107100
}
108101

109102
func (r *Retry) postCheck(err error) bool {
103+
err = errors.Cause(err)
110104
for _, fn := range r.postConditions {
111105
if !fn(err) {
112106
return false

0 commit comments

Comments
 (0)