thank you both for your replies! On Sunday, January 28, 2018 at 2:49:01 PM UTC+8, evan wrote: > > > in the code snippet below which is inside a function, is "defer > resp.Body.Close() " in the appropriate position? > am i required to always do a resp.Body.Close()? > ... > resp, err := client.Do(req) > > log.Printf("resp: %+v\n", resp) > if resp.StatusCode != http.StatusOK { > return errors.NewHTTPError(resp.StatusCode) > } > .... > defer resp.Body.Close() >
-- 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.