lib/promscrape/discovery/gce: make golint happy by ignoring resp.Body.Close() result

This commit is contained in:
Aliaksandr Valialkin 2020-04-24 18:13:01 +03:00
parent 987fcce93d
commit 7c74efd640

View file

@ -54,7 +54,9 @@ func getInstancesPage(cfg *apiConfig, pageToken string) ([]Instance, string, err
if err != nil {
return nil, "", fmt.Errorf("cannot obtain instances data from API server: %s", err)
}
defer resp.Body.Close()
defer func() {
_ = resp.Body.Close()
}()
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, "", fmt.Errorf("cannot read instances data from API server: %s", err)