Skip to content

Instantly share code, notes, and snippets.

@yuya-takeyama
Created April 5, 2015 18:31
Show Gist options
  • Save yuya-takeyama/6f31950fdf0b1d3e3d89 to your computer and use it in GitHub Desktop.
Save yuya-takeyama/6f31950fdf0b1d3e3d89 to your computer and use it in GitHub Desktop.
Go でリトライのインターフェイスを考える
package main
func main() {
var ret Type
retryErr := retry.Do(3, retry.Exponential(time.Second), func() error {
ret, err := SomeFunc()
return err
})
if retryErr != nil {
fmt.Println("Retry error")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment