fix: close resp body (bodyclose)
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
d129b94fc5
commit
9f65e89760
2 changed files with 5 additions and 0 deletions
|
|
@ -1549,6 +1549,8 @@ func RepoExists(client *Client, repo ghrepo.Interface) (bool, error) {
|
|||
return false, err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
switch resp.StatusCode {
|
||||
case 200:
|
||||
return true, nil
|
||||
|
|
|
|||
|
|
@ -526,6 +526,8 @@ func getTopics(ctx context.Context, httpClient *http.Client, repo ghrepo.Interfa
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return nil, api.HandleHTTPError(res)
|
||||
}
|
||||
|
|
@ -563,6 +565,7 @@ func setTopics(ctx context.Context, httpClient *http.Client, repo ghrepo.Interfa
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return api.HandleHTTPError(res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue