From d957ce10202896f2da4262340cd73fb4faa75836 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 8 Mar 2024 10:19:25 +0800 Subject: [PATCH] net/http: close res.Body Signed-off-by: guoguangwu --- src/net/http/response_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/http/response_test.go b/src/net/http/response_test.go index f3425c3c20..a63aac95ac 100644 --- a/src/net/http/response_test.go +++ b/src/net/http/response_test.go @@ -826,6 +826,7 @@ func TestResponseContentLengthShortBody(t *testing.T) { if err != nil { t.Fatal(err) } + defer res.Body.Close() if res.ContentLength != 123 { t.Fatalf("Content-Length = %d; want 123", res.ContentLength) }