github-vet / github-vet/rangeloop-pointer-findings
spreadsheetdb/go-vet-examples: range.go; 5 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [spreadsheetdb/go-vet-examples](https://www.github.com/spreadsheetdb/go-vet-examples) at [range.go](https://github.com/spreadsheetdb/go-vet-examples/blob/ffa4160174d2e1d41f109fbf7b449c4e07a3e4cd/range.go#L8-L12)
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 word used in defer or goroutine at line 10
[Click here to see the code in its original context.](https://github.com/spreadsheetdb/go-vet-examples/blob/ffa4160174d2e1d41f109fbf7b449c4e07a3e4cd/range.go#L8-L12)
Click here to show the 5 line(s) of Go which triggered the analyzer.
```go
for _, word := range words {
go func() {
fmt.Println(word)
}()
}
```
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: ffa4160174d2e1d41f109fbf7b449c4e07a3e4cd
Contributor guide
No contributing guide indexed for this repository
Research direction
Read range.go at lines 8-12 and review the reported range-loop capture in the shown goroutine. Compare it with the linked classification guidance, then leave the appropriate reaction; done means the instance is classified as Bug, Mitigated, or Desirable Behavior.
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
- 35/100