mirror of
https://github.com/SourceFellows/gobuch.git
synced 2024-10-22 13:57:13 +00:00
22 lines
370 B
Go
22 lines
370 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/hashicorp/go-retryablehttp"
|
|
)
|
|
|
|
func main() {
|
|
retryClient := retryablehttp.NewClient()
|
|
retryClient.RetryMax = 10
|
|
|
|
standardClient := retryClient.StandardClient()
|
|
|
|
res, err := standardClient.Get("http://localhost:8080/")
|
|
if err != nil {
|
|
log.Fatal("could not request")
|
|
}
|
|
defer res.Body.Close()
|
|
log.Println(res.Status)
|
|
}
|