Commit e831bd1f authored by Marcel Edmund Franke's avatar Marcel Edmund Franke Committed by Brad Fitzpatrick

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/38059Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent b71ed4ed
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment