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.
retry
✓ github.com/Rican7/retry
Retry an action up to 3 times.
package main
import (
"fmt"
"github.com/Rican7/retry"
"github.com/Rican7/retry/strategy"
)
func main() {
action := func(attempt uint) error {
fmt.Println("Attempt", attempt)
return fmt.Errorf("failed")
}
err := retry.Retry(action, strategy.Limit(3))
if err != nil {
fmt.Println("Final error:", err)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.3.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.