From: guoguangwu Date: Fri, 8 Mar 2024 02:25:30 +0000 (+0000) Subject: net/http: close res.Body X-Git-Tag: go1.23rc1~957 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e03e06d5601cf844c6dbd81269ddbea8b55ad7ab;p=gostls13.git net/http: close res.Body Change-Id: I0f9faf2a946ebebf9ae30f065f20ec6028c65c22 GitHub-Last-Rev: d957ce10202896f2da4262340cd73fb4faa75836 GitHub-Pull-Request: golang/go#66181 Reviewed-on: https://go-review.googlesource.com/c/go/+/569976 Reviewed-by: Michael Knyszek Auto-Submit: Damien Neil LUCI-TryBot-Result: Go LUCI Reviewed-by: Damien Neil --- 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) }