github-vet / github-vet/rangeloop-pointer-findings
andrii-riabchun/GithubPotentials: channel.go; 28 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [andrii-riabchun/GithubPotentials](https://www.github.com/andrii-riabchun/GithubPotentials) at [channel.go](https://github.com/andrii-riabchun/GithubPotentials/blob/139ac2d8b7502bf9b181339935622f0624b1e460/channel.go#L37-L64)
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 43
[Click here to see the code in its original context.](https://github.com/andrii-riabchun/GithubPotentials/blob/139ac2d8b7502bf9b181339935622f0624b1e460/channel.go#L37-L64)
Click here to show the 28 line(s) of Go which triggered the analyzer.
```go
for repo := range in {
joiner := new(sync.WaitGroup)
joiner.Add(2)
go func() {
defer joiner.Done()
commitsCount, contribsCount, err := i.countCommitsAndContributors(repo.Owner, repo.Name)
if err != nil {
i.log.Println(err)
return
}
repo.Commits = commitsCount
repo.Contribs = contribsCount
}()
go func() {
defer joiner.Done()
starsCount, err := i.countStars(repo.Owner, repo.Name)
if err != nil {
i.log.Println(err)
return
}
repo.Stars = starsCount
}()
joiner.Wait()
out <- repo
}
```
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: 139ac2d8b7502bf9b181339935622f0624b1e460
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.