......
resp, err := httplib.Get(url)
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
......
Is it necessary to close the response body every time?
......
resp, err := httplib.Get(url)
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
......
Is it necessary to close the response body every time?
Quoting from the official documentation of the http package:
The client must close the response body when finished with it