Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
try
✓ github.com/matryer/try
Retries a function up to 3 times
package main
import (
"fmt"
"github.com/matryer/try"
)
func main() {
err := try.Do(func(attempt int) (bool, error) {
fmt.Println("Attempt", attempt)
return attempt < 3, nil
})
if err != nil {
panic(err)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20161228173917-9ac251b645a2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.