Re:Show HN: Example implementation of Mozilla's persona and ...
by krf on Thursday May 23, 2013 @02:10PM
(#5758407)
I'm new to Go but shouldn't the defer rawResp.Body.Close() be done after the error checking. If there is an error wouldn't rawResp be nil ?
[ Parent
| on HN ]
Re:Show HN: Example implementation of Mozilla's persona and ...
by sauerbraten on Thursday May 23, 2013 @02:18PM
(#5758468)
You're right. Fixed it, thanks!
Re:Show HN: Example implementation of Mozilla's persona and ...
by realrocker on Thursday May 23, 2013 @02:20PM
(#5758478)
Yup. It should be closed or it will probably leak memory in a few hours.
Re:Show HN: Example implementation of Mozilla's persona and ...
by sauerbraten on Thursday May 23, 2013 @02:35PM
(#5758583)
Not really. Memory would only be leaked if there really was an error and rawResp was still nil. Since this usually doesn't happen (at least it never happened to me), you probably wouldn't even have noticed this bug.