@@ -35,9 +35,9 @@ func Timeout(timeout, delay time.Duration, f func() error) error {
35
35
36
36
var errCeilLessThanFloor = errors .New ("ceiling cannot be less than the floor" )
37
37
38
- // NotNil is a condition function that if passed to a Backoff,
38
+ // notNil is a condition function that if passed to a Backoff,
39
39
// will continue retrying until the error is nil.
40
- func NotNil (err error ) bool { return err != nil }
40
+ func notNil (err error ) bool { return err != nil }
41
41
42
42
// Backoff implements an exponential backoff algorithm.
43
43
// It calls f before timeout is exceeded using ceil as a maximum sleep
@@ -46,7 +46,7 @@ func NotNil(err error) bool { return err != nil }
46
46
// it will return by timeout.
47
47
// If timeout is 0, it will run until the function returns a nil error.
48
48
func Backoff (timeout , ceil , floor time.Duration , f func () error ) error {
49
- return BackoffWhile (timeout , ceil , floor , f , NotNil )
49
+ return BackoffWhile (timeout , ceil , floor , f , notNil )
50
50
}
51
51
52
52
// BackoffWhile implements an exponential backoff algorithm.
@@ -95,7 +95,7 @@ func BackoffWhile(timeout, ceil, floor time.Duration, f func() error, cond func(
95
95
// It calls f before the context is cancelled using ceil as a maximum sleep
96
96
// interval and floor as the start interval.
97
97
func BackoffContext (ctx context.Context , ceil , floor time.Duration , f func () error ) error {
98
- return BackoffContextWhile (ctx , ceil , floor , f , NotNil )
98
+ return BackoffContextWhile (ctx , ceil , floor , f , notNil )
99
99
}
100
100
101
101
func BackoffContextWhile (ctx context.Context , ceil , floor time.Duration , f func () error , cond func (error ) bool ) error {
0 commit comments