Registry / utility / avast-retry-go-v3

avast-retry-go-v3

JSON →
library3.1.1gogounverified

Simple library for retry mechanism in Go, inspired by Try::Tiny::Retry.

go get github.com/avast/retry-go/v3
INSTALL
IMPORT
SIG · AVAST-RETRY-GO-V3
A
avast-retry-go-v3
utilitygov3.1.1
harness data pending
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.

retry
github.com/avast/retry-go/v3

Retry an HTTP GET request with default retry policy.

package main import ( "fmt" "io/ioutil" "net/http" "github.com/avast/retry-go/v3" ) func main() { url := "http://example.com" var body []byte err := retry.Do( func() error { resp, err := http.Get(url) if err != nil { return err } defer resp.Body.Close() body, err = ioutil.ReadAll(resp.Body) if err != nil { return err } return nil }, ) if err != nil { fmt.Println("Failed:", err) } else { fmt.Println(string(body)) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.1.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
2
Resources
avast-retry-go-v3 — go get avast-retry-go-v3 · libregistry