https://github.com/go-playground/retry
:arrows_counterclockwise: Retry provides a set of standardized common components and abstracts away some code that normally is duplicated
https://github.com/go-playground/retry
retry
Last synced: 5 months ago
JSON representation
:arrows_counterclockwise: Retry provides a set of standardized common components and abstracts away some code that normally is duplicated
- Host: GitHub
- URL: https://github.com/go-playground/retry
- Owner: go-playground
- License: mit
- Created: 2017-12-31T19:15:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-31T20:18:23.000Z (almost 8 years ago)
- Last Synced: 2025-04-09T01:51:13.589Z (6 months ago)
- Topics: retry
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 17
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Retry library
=============

[](https://travis-ci.org/go-playground/retry)
[](https://coveralls.io/github/go-playground/retry?branch=master)
[](https://goreportcard.com/report/github.com/go-playground/retry)
[](https://godoc.org/github.com/go-playground/retry)
Retry library provides a set of standardized common components and abstracts away some code that normally is duplicated.
My motivation is not to reinvent the wheel but to standardize a set of components for reuse in other libraries.Example
------------
```go
package mainimport (
"errors"
"fmt""github.com/go-playground/retry"
)func main() {
err := retry.Run(5, func() (bool, error) {
return false, errors.New("ERR")
},
func(attempt uint16, err error) {
fmt.Printf("Attempt: %d Error: %s\n", attempt, err)
},
)
if err != nil {
panic(err)
}
}```
Package Versioning
---------------
I'm jumping on the vendoring bandwagon, you should vendor this package as I will not
be creating different version with gopkg.in like allot of my other libraries.Why? because my time is spread pretty thin maintaining all of the libraries I have + LIFE,
it is so freeing not to worry about it and will help me keep pouring out bigger and better
things for you the community.License
------
Distributed under MIT License, please see license file in code for more details.