From 29f9297f4777650b24aac0f4252df00c257b73d0 Mon Sep 17 00:00:00 2001 From: Daniel Rocha Date: Thu, 1 Nov 2018 01:26:50 +0100 Subject: [PATCH] Close response body --- htp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htp.go b/htp.go index 50855ee..7d27176 100644 --- a/htp.go +++ b/htp.go @@ -11,7 +11,7 @@ import ( func main() { n := flag.Uint("n", 12, "Number of requests") - h := flag.String("u", "https://google.com", "Host URL") + h := flag.String("u", "https://www.google.com", "Host URL") flag.Parse() lo, hi := math.Inf(-1), math.Inf(+1) @@ -22,6 +22,7 @@ func main() { if err != nil { log.Fatal(err) } + resp.Body.Close() date := resp.Header.Get("Date") t2, err := time.Parse(time.RFC1123, date) if err != nil {