Hi all,
I've released backoff, a small package for generating backoff durations in retry loops using Go 1.23+ iterators.
Basic usage:
```
for attempt := range backoff.Attempts(ctx, time.Second, 30*time.Second, backoff.Exponential(2), 5) {
if err := doSomething(); err == nil {
return nil
}
}
return errors.New("max retries exceeded")
```
It supports linear, incremental and exponential step functions, as well as context cancelation, and jitter.
Feedback and contributions welcome!