mirror of
https://github.com/distribution/distribution.git
synced 2025-09-15 14:48:31 +00:00
Enable bodyclose linter
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
@@ -656,7 +656,9 @@ func (suite *DriverSuite) TestURLFor(c *check.C) {
|
||||
}
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
response, _ = http.Head(url)
|
||||
response, err = http.Head(url)
|
||||
c.Assert(err, check.IsNil)
|
||||
defer response.Body.Close()
|
||||
c.Assert(response.StatusCode, check.Equals, 200)
|
||||
c.Assert(response.ContentLength, check.Equals, int64(32))
|
||||
}
|
||||
|
Reference in New Issue
Block a user