On 14 Feb 2018, at 10:50, mrx <patrik....@gmail.com<mailto:patrik....@gmail.com>> wrote:
resp, err := http.Get("http://example.com/") if err != nil { // handle error } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) That err returned from ReadAll. I cannot see how that can possibly fail. You need a more vivid imagination. The server might crash, the network might fail, a firewall in between might reboot, and so on. Any issue along the path might result in a timeout, short read (server said “content-lenght: 42” only sent five bytes), or other errors. //jb -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.