Enable bodyclose linter

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos
2023-08-19 09:16:02 +01:00
parent 597e8a6b34
commit 3dbfbc7255
11 changed files with 87 additions and 15 deletions

View File

@@ -67,6 +67,8 @@ func fetchAWSIPs(url string) (awsIPResponse, error) {
if err != nil {
return response, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
body, _ := io.ReadAll(resp.Body)
return response, fmt.Errorf("failed to fetch network data. response = %s", body)