github-vet / github-vet/rangeloop-pointer-findings
FunStuff/pproxies: proxypool.go; 12 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [FunStuff/pproxies](https://www.github.com/FunStuff/pproxies) at [proxypool.go](https://github.com/FunStuff/pproxies/blob/542565cefdb891608966fc7c7dfa03a62575f9e7/proxypool.go#L94-L105)
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 src used in defer or goroutine at line 98
[Click here to see the code in its original context.](https://github.com/FunStuff/pproxies/blob/542565cefdb891608966fc7c7dfa03a62575f9e7/proxypool.go#L94-L105)
Click here to show the 12 line(s) of Go which triggered the analyzer.
```go
for i, src := range pool.srcs {
waiter.Add(1)
go func(i int) {
defer waiter.Done()
proxies, err := src(SrcTimeout)
if err != nil {
return
}
logger.Printf("fetched %d proxies from src %d\n", len(proxies), i)
test(proxies, opt.ChunkSize, opt.Timeout, opt.TestURL, stop, out)
}(i)
}
```
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: 542565cefdb891608966fc7c7dfa03a62575f9e7
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with proxypool.go lines 94-105 at commit 542565cefdb891608966fc7c7dfa03a62575f9e7 and review the analyzer's range-loop warning about src in the goroutine. Compare the behavior with the project's Bug, Mitigated, and Desirable Behavior classification guidance; done means leaving the appropriate reaction on the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100