Created
January 25, 2017 19:30
-
-
Save wsong/024fdb01974c47de15998c3ccfa6099c to your computer and use it in GitHub Desktop.
This file contains 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
func retryLoop() { | |
var lastError error | |
for i := 0; i < 10; i++ { | |
val, lastError := doSomething() | |
if lastError == nil { | |
break | |
} | |
} | |
return lastError | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment