From 778f83ed894a22f220baa149ea1a1defd0245f3c Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 27 Jun 2016 18:26:56 +0300 Subject: [PATCH] Discourage using ReleaseBody, since now bytebufferpool should properly handle the case mentioned in #102 --- http.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/http.go b/http.go index bd6eff9..6aab09a 100644 --- a/http.go +++ b/http.go @@ -447,6 +447,9 @@ func (resp *Response) ResetBody() { // // This permits GC to reclaim the large buffer. If used, must be before // ReleaseResponse. +// +// Use this method only if you really understand how it works. +// The majority of workloads don't need this method. func (resp *Response) ReleaseBody(size int) { if cap(resp.body.B) > size { resp.closeBodyStream() @@ -458,6 +461,9 @@ func (resp *Response) ReleaseBody(size int) { // // This permits GC to reclaim the large buffer. If used, must be before // ReleaseRequest. +// +// Use this method only if you really understand how it works. +// The majority of workloads don't need this method. func (req *Request) ReleaseBody(size int) { if cap(req.body.B) > size { req.closeBodyStream()