fix lint issue on body close

This commit is contained in:
jnfrati
2026-07-06 13:35:19 +02:00
parent de2e0f541b
commit 59a09b0ff3

View File

@@ -124,13 +124,18 @@ func search(client *httpu.HTTPUClient, gatewayAddr, searchTarget string) ([]stri
},
}
responses, err := client.Do(req, searchTimeout, searchRepeats)
responses, err := client.Do(req, searchTimeout, searchRepeats) //nolint:bodyclose // httpu.Do returns a slice; bodies are closed in the loop below.
if err != nil {
return nil, err
}
var locations []string
for _, resp := range responses {
if resp.Body != nil {
if err := resp.Body.Close(); err != nil {
log.Debugf("close SSDP response body: %v", err)
}
}
if resp.StatusCode != http.StatusOK {
continue
}