mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-18 04:29:54 +00:00
fix lint issue on body close
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user