Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
matryer committed Feb 20, 2015
1 parent 62b916f commit 9162e81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Idiomatic Go retry package

## Usage

Just call `try.Do` with the function you want to retry in the event of an error:

```
var value string
err := try.Do(func(attempt int) (error, bool) {
Expand Down Expand Up @@ -32,6 +34,8 @@ To see if a `Do` operation failed due to reaching the limit, you can check the `

#### Retrying panics

Try supports retrying in the event of a panic.

* Use named return parameters
* Set `retry` first
* Defer the recovery code, and set `err` manually in the case of a panic
Expand Down

0 comments on commit 9162e81

Please sign in to comment.