On Fri, Jul 29, 2016 at 2:01 AM, wrote:
> Thanks James, are there any golang tools which could have caught this
> issue. I know go vet didnt.
Caught the issue of using the first odd pattern for closing the response
Body? There's no tool that can detect general logic
On Thursday, July 28, 2016 at 2:34:24 PM UTC-4, krma...@gmail.com wrote:
>
> WHere is this documented in "On error, any Response can be ignored. A
> non-nil Response with a non-nil error only occurs when CheckRedirect fails,
> and even then the returned Response.Body is already closed"
>
> I
WHere is this documented in "On error, any Response can be ignored. A
non-nil Response with a non-nil error only occurs when CheckRedirect fails,
and even then the returned Response.Body is already closed"
I am interested in looking at it. I didnt find it
here https://golang.org/pkg/net/http/
On Thu, Jul 28, 2016 at 11:08 AM, Ian Davis wrote:
> Great. Very clear.
>
> To those looking for this: it's a new comment added after 1.6.2
>
Thanks, forgot I was on master.
Yes, this was implied by the error handling example in the docs, but now is
much more explicit.
--
On Thu, Jul 28, 2016 at 10:39 AM, Ian Davis wrote:
> Is it? The http package only says:
>
> "When err is nil, resp always contains a non-nil resp.Body. Caller should
> close resp.Body when done reading from it."
>
> It doesn't say anything about the case where err != nil
>
>