github-vet / github-vet/rangeloop-pointer-findings
goki/pi: spell/model.go; 5 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [goki/pi](https://www.github.com/goki/pi) at [spell/model.go](https://github.com/goki/pi/blob/ca330b91d1a1db95c3679c3ba625e17c3f59252f/spell/model.go#L601-L605)
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.
> reference to pot was used in a composite literal at line 603
[Click here to see the code in its original context.](https://github.com/goki/pi/blob/ca330b91d1a1db95c3679c3ba625e17c3f59252f/spell/model.go#L601-L605)
Click here to show the 5 line(s) of Go which triggered the analyzer.
```go
for _, pot := range sugg {
if _, ok := suggestions[pot]; !ok {
suggestions[pot] = &Potential{Term: pot, Score: md.corpusCount(pot), Leven: Levenshtein(&input, &pot), Method: MethodSuggestMapsToInput}
}
}
```
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: ca330b91d1a1db95c3679c3ba625e17c3f59252f
Contributor guide
No contributing guide indexed for this repository
Research direction
Open spell/model.go at lines 601-605 and inspect how the range variable pot is referenced in the composite literal. Check the surrounding code and analyzer guidance to determine whether this is a bug, mitigated, or desirable behavior, then classify the finding with the corresponding reaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100