github-vet / github-vet/rangeloop-pointer-findings
derekchuank/rss-email: fetchfeed.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [derekchuank/rss-email](https://www.github.com/derekchuank/rss-email) at [fetchfeed.go](https://github.com/derekchuank/rss-email/blob/bac52d6800993ce982dd1017000f0093b87ab239/fetchfeed.go#L23-L37)
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 url used in defer or goroutine at line 29
[Click here to see the code in its original context.](https://github.com/derekchuank/rss-email/blob/bac52d6800993ce982dd1017000f0093b87ab239/fetchfeed.go#L23-L37)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for url := range subscription.m {
// url not a valid feed
if subscription.m[url].error != nil && subscription.m[url].error.Error() == "Failed to detect feed type" {
continue
}
go func() {
res, err := httpGet(url)
ch <- &httpGetRes{
url: url,
txt: res,
error: err,
}
}()
goNum++
}
```
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: bac52d6800993ce982dd1017000f0093b87ab239
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with fetchfeed.go lines 23–37 and inspect how the range-loop variable url is used inside the goroutine. Review the analyzer warning and the surrounding subscription and result-channel flow, then verify that the reported capture issue is resolved without changing the intended feed-fetching behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100