All hail the mighty linter

This commit is contained in:
Till Faelligen 2022-10-26 13:31:07 +02:00
parent ad0aaa92d1
commit bfd776abf6
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -181,13 +181,14 @@ func requestDo[T thirdpartyResponses](client *http.Client, url string, response
// try v1 and unstable appservice endpoints // try v1 and unstable appservice endpoints
for _, version := range []string{"v1", "unstable"} { for _, version := range []string{"v1", "unstable"} {
var resp *http.Response var resp *http.Response
var body []byte
asURL := strings.Replace(origURL, "unstable", version, 1) asURL := strings.Replace(origURL, "unstable", version, 1)
resp, err = client.Get(asURL) resp, err = client.Get(asURL)
if err != nil { if err != nil {
continue continue
} }
defer resp.Body.Close() // nolint: errcheck defer resp.Body.Close() // nolint: errcheck
body, err := io.ReadAll(resp.Body) body, err = io.ReadAll(resp.Body)
if err != nil { if err != nil {
continue continue
} }