From e831bd1fcae591a4dd985c4f75b455355033c75b Mon Sep 17 00:00:00 2001 From: Marcel Edmund Franke Date: Sun, 12 Mar 2017 12:19:32 +0100 Subject: [PATCH] net/http: fix body close statement is missing Call body close after ioutil.ReadAll is done Change-Id: Ieceb1965a6a8f2dbc024e983acdfe22df17d07d1 Reviewed-on: https://go-review.googlesource.com/38059 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/net/http/filetransport_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/http/filetransport_test.go b/src/net/http/filetransport_test.go index 6f1a537e2e..2a2f32c769 100644 --- a/src/net/http/filetransport_test.go +++ b/src/net/http/filetransport_test.go @@ -49,6 +49,7 @@ func TestFileTransport(t *testing.T) { t.Fatalf("for %s, nil Body", urlstr) } slurp, err := ioutil.ReadAll(res.Body) + res.Body.Close() check("ReadAll "+urlstr, err) if string(slurp) != "Bar" { t.Errorf("for %s, got content %q, want %q", urlstr, string(slurp), "Bar") -- 2.48.1