Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

tinrab/retry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated. Use https://github.com/tinrab/kit instead.

Retry

A simple retry package for Go.

Usage

Retry 10 times.

err := retry.Do(10, thisFunctionMayFail)
if err != nil {
  log.Fatal(err)
}

Retry with a delay.

err := retry.DoSleep(10, 3 * time.Second, thisFunctionMayFail)
if err != nil {
  log.Fatal(err)
}

Retry forever.

retry.Forever(thisFunctionMayFail)