github-vet / github-vet/rangeloop-pointer-findings
hoshsadiq/m3ufilter: m3u/process.go; 22 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [hoshsadiq/m3ufilter](https://www.github.com/hoshsadiq/m3ufilter) at [m3u/process.go](https://github.com/hoshsadiq/m3ufilter/blob/ba3f14671316885b7230528a256e46bdf7e6d1a0/m3u/process.go#L149-L170)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first
issue it finds, so please do not limit your consideration to the contents of the below message.
> range-loop variable provider used in defer or goroutine at line 157
[Click here to see the code in its original context.](https://github.com/hoshsadiq/m3ufilter/blob/ba3f14671316885b7230528a256e46bdf7e6d1a0/m3u/process.go#L149-L170)
Click here to show the 22 line(s) of Go which triggered the analyzer.
```go
for i, provider := range providers {
resp, err := getUri(provider.Uri)
if err != nil {
return nil, err
}
defer func() {
err := resp.Body.Close()
if err != nil {
log.Errorf("could not close request body for provider %s, err = %v", provider.Uri, err)
}
}()
newEpg = xmltv.XMLTV{}
err = xmltv.Load(resp.Body, &newEpg)
if err != nil {
return nil, err
}
applyEpgIdRenames(&newEpg, provider.ChannelIdRenames)
epgs[i] = newEpg
totalChannels += len(newEpg.Channels)
totalProgrammes += len(newEpg.Programmes)
}
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: ba3f14671316885b7230528a256e46bdf7e6d1a0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.