diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-03-15 00:39:40 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-03-15 00:39:40 +0100 |
commit | 30eef8f7202af3cd09cd371b356d31c97a0573b1 (patch) | |
tree | 0597598b1020e9b44693ed49f88fa40f7cd86ceb | |
parent | 8385501cb7b07f7ae5b924752da68cbf12d885a0 (diff) | |
download | htping-30eef8f7202af3cd09cd371b356d31c97a0573b1.tar.gz htping-30eef8f7202af3cd09cd371b356d31c97a0573b1.tar.xz htping-30eef8f7202af3cd09cd371b356d31c97a0573b1.zip |
rename durs to results
-rw-r--r-- | htping.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/htping.go b/htping.go index f511464..f933814 100644 --- a/htping.go +++ b/htping.go @@ -110,7 +110,7 @@ type result struct { code int } -func ping(url string, seq int, durs chan result) { +func ping(url string, seq int, results chan result) { start := time.Now() atomic.AddInt32(&ntotal, 1) @@ -120,7 +120,7 @@ func ping(url string, seq int, durs chan result) { req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Printf("error=%v\n", err) - durs <- result{0, -1} + results <- result{0, -1} return } @@ -143,7 +143,7 @@ func ping(url string, seq int, durs chan result) { res, err := client.Do(req) if err != nil { fmt.Printf("error=%v\n", err) - durs <- result{0, -1} + results <- result{0, -1} return } @@ -166,7 +166,7 @@ func ping(url string, seq int, durs chan result) { res.StatusCode, seq, dur) - durs <- result{dur, res.StatusCode} + results <- result{dur, res.StatusCode} } func stats(results chan result, done chan bool) { |