github-vet / github-vet/rangeloop-pointer-findings
robphoenix/concurrency-made-easy: 01-original/main.go; 12 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [robphoenix/concurrency-made-easy](https://www.github.com/robphoenix/concurrency-made-easy) at [01-original/main.go](https://github.com/robphoenix/concurrency-made-easy/blob/1082a986bcdcd64f36864703474f15bb197c66cf/01-original/main.go#L24-L35)
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 repo used in defer or goroutine at line 31
[Click here to see the code in its original context.](https://github.com/robphoenix/concurrency-made-easy/blob/1082a986bcdcd64f36864703474f15bb197c66cf/01-original/main.go#L24-L35)
Click here to show the 12 line(s) of Go which triggered the analyzer.
```go
for _, repo := range repos {
sem <- 1
go func() {
defer func() {
wg.Done()
<-sem
}()
if err := fetch(repo); err != nil {
errChan <- err
}
}()
}
```
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: 1082a986bcdcd64f36864703474f15bb197c66cf
Contributor guide
No contributing guide indexed for this repository
Research direction
Open 01-original/main.go at lines 24-35 and compare the captured repo use with the analyzer's range-loop guidance. Read the linked classification descriptions, then leave the appropriate reaction; done means the finding is marked Bug, Mitigated, or Desirable Behavior.
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
- Clearly specified
- Newbie friendliness
- 35/100