github-vet / github-vet/rangeloop-pointer-findings
dmitryrpm/maxima-tests: test7.go; 7 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [dmitryrpm/maxima-tests](https://www.github.com/dmitryrpm/maxima-tests) at [test7.go](https://github.com/dmitryrpm/maxima-tests/blob/2fd93ee3ac53e9be692bd81cb226349a7473a4cd/test7.go#L12-L18)
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 v used in defer or goroutine at line 15
[Click here to see the code in its original context.](https://github.com/dmitryrpm/maxima-tests/blob/2fd93ee3ac53e9be692bd81cb226349a7473a4cd/test7.go#L12-L18)
Click here to show the 7 line(s) of Go which triggered the analyzer.
```go
for _, v := range data {
wg.Add(1)
go func() {
fmt.Println(v)
wg.Done()
}()
}
```
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: 2fd93ee3ac53e9be692bd81cb226349a7473a4cd
Contributor guide
No contributing guide indexed for this repository
Research direction
Open test7.go at lines 12-18 and inspect how the goroutine uses the range-loop variable v. Decide whether the analyzer finding is a Bug, Mitigated, or Desirable Behavior, then leave the corresponding reaction on the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100