Retry¶
func Retry(fn func() error, maxAttempts int) error
Retry executes a function up to maxAttempts times, returning the first successful result. Returns the last error if all attempts fail. Returns an error if maxAttempts is less than 1.
func Retry(fn func() error, maxAttempts int) error
Retry executes a function up to maxAttempts times, returning the first successful result. Returns the last error if all attempts fail. Returns an error if maxAttempts is less than 1.