Created
April 5, 2015 18:31
-
-
Save yuya-takeyama/6f31950fdf0b1d3e3d89 to your computer and use it in GitHub Desktop.
Go でリトライのインターフェイスを考える
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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