We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec332fb commit 11a3f1fCopy full SHA for 11a3f1f
api/client.go
@@ -69,6 +69,7 @@ func (c *Client) Do(req *http.Request) (*http.Response, error) {
69
if err != nil {
70
return nil, err
71
}
72
+ defer res.Body.Close()
73
74
debug.DumpResponse(res)
75
return res, nil
@@ -85,6 +86,8 @@ func (c *Client) TokenIsValid() (bool, error) {
85
86
87
return false, err
88
89
+ defer resp.Body.Close()
90
+
91
return resp.StatusCode == http.StatusOK, nil
92
93
@@ -99,6 +102,8 @@ func (c *Client) IsPingable() error {
99
102
100
103
return err
101
104
105
106
107
if resp.StatusCode != http.StatusOK {
108
return fmt.Errorf("API returned %s", resp.Status)
109
0 commit comments