Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
backoff
✓ github.com/giantswarm/backoff
Retry an operation with exponential backoff
package main
import (
"fmt"
"time"
"github.com/giantswarm/backoff"
)
func main() {
operation := func() error {
return fmt.Errorf("temporary error")
}
err := backoff.Retry(operation, backoff.NewExponential(2*time.Second, 30*time.Second))
if err != nil {
fmt.Println("Failed after retries:", err)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.0.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.