FAQ

On Tuesday, January 20, 2015 at 9:22:09 AM UTC-5, Lars Tørnes Hansen wrote:
Has to correct myself:

resp could of course be nil, so use this edited code:
http://play.golang.org/p/FjSSZkysYF
This could be incorrect too. The response isn't guaranteed to be nil when
there's an error, but the Body is.

It's better to just follow the documented pattern of `defer
resp.Body.Close()` if there is no error.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 15 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 19, '15 at 4:38p
activeJan 21, '15 at 3:59p
posts15
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase