github-vet / github-vet/rangeloop-pointer-findings

lilee/tasty: cf/eval/base.go; 12 LoC

Open
#5,969 0 comments 2 reactions 0 assignees View on GitHub
experts: :-1: small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [lilee/tasty](https://www.github.com/lilee/tasty) at [cf/eval/base.go](https://github.com/lilee/tasty/blob/5b5ea54574cc93333de86a428bc9e59b649275a5/cf/eval/base.go#L28-L39)

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 prefs used in defer or goroutine at line 30

[Click here to see the code in its original context.](https://github.com/lilee/tasty/blob/5b5ea54574cc93333de86a428bc9e59b649275a5/cf/eval/base.go#L28-L39)

Click here to show the 12 line(s) of Go which triggered the analyzer.

```go
for uid, prefs := range(tests.Raw()) {
go func() {
for _, p := range(prefs.Raw()) {
estimatedPreference, err := r.EstimatePreference(uid, p.ItemId())
if err != nil {
} else {
//TODO: capper
this.processOneEstimate(estimatedPreference, p)
}
}
}()
}

```

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: 5b5ea54574cc93333de86a428bc9e59b649275a5

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.