diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2021-01-24 12:26:02 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2021-01-24 12:26:02 -0500 |
| commit | bad568d0a26ad348f25a4556266ba98f73b3be02 (patch) | |
| tree | 6eb909e37d7b65472381a17362283b6765adfc14 /http.go | |
| parent | 0539b119a4c205a96590b356849215b6e1b1ed35 (diff) | |
| download | checkup-bad568d0a26ad348f25a4556266ba98f73b3be02.tar.gz checkup-bad568d0a26ad348f25a4556266ba98f73b3be02.tar.xz | |
Run requests concurrently
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3,10 +3,13 @@ package checkup import ( "fmt" "net/http" + "time" ) func HttpStatusOK(url string, status int) error { - resp, err := http.Get(url) + client := &http.Client{Timeout: 5 * time.Second} + + resp, err := client.Get(url) if err != nil { return err |
