Also... TIL...
resp, err := http.Get(...) if err != nil { return err } defer resp.body.Close() json.NewDecoder(resp.Body).Decode(&foo)
This leaves the HTTP connection open a fraction longer than desired, because it may not have consumed the input up to the EOF.
Need to add this after it:
io.Copy(ioutil.Discard, resp.Body)
@Velocio started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
Also... TIL...
This leaves the HTTP connection open a fraction longer than desired, because it may not have consumed the input up to the EOF.
Need to add this after it: