linting the code

This commit is contained in:
9seconds
2019-10-11 09:41:18 +03:00
parent 432e2970a0
commit 5009859a1e
50 changed files with 172 additions and 55 deletions
+3 -1
View File
@@ -22,15 +22,17 @@ func request(url string) (io.ReadCloser, error) {
if err != nil {
panic(err)
}
req.Header.Set("Accept", "text/plan")
req.Header.Set("User-Agent", apiUserAgent)
resp, err := httpClient.Do(req)
if err != nil {
if resp != nil {
io.Copy(ioutil.Discard, resp.Body)
io.Copy(ioutil.Discard, resp.Body) // nolint: errcheck
resp.Body.Close()
}
return nil, fmt.Errorf("cannot perform a request: %w", err)
}