github-vet / github-vet/rangeloop-pointer-findings
yifeili3/GeoCube: knn.go; 6 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [yifeili3/GeoCube](https://www.github.com/yifeili3/GeoCube) at [knn.go](https://github.com/yifeili3/GeoCube/blob/03fd505175e47bd9519546d7eeb2af7ae1add1d1/knn.go#L208-L213)
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 dp is reassigned at line 210
[Click here to see the code in its original context.](https://github.com/yifeili3/GeoCube/blob/03fd505175e47bd9519546d7eeb2af7ae1add1d1/knn.go#L208-L213)
Click here to show the 6 line(s) of Go which triggered the analyzer.
```go
for _, dp := range dataPoints {
knnDp := new(KNNPoint)
knnDp.dPoint = &dp
knnDp.distance = query.DistanceToCenter(knnDp.dPoint)
heap.Push(dataPointsPQ, knnDp)
}
```
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: 03fd505175e47bd9519546d7eeb2af7ae1add1d1
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.