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

kpankonen/ld-daemon: Godeps/_workspace/src/github.com/launchdarkly/go-client/flag.go; 12 LoC

Open
#15,955 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [kpankonen/ld-daemon](https://www.github.com/kpankonen/ld-daemon) at [Godeps/_workspace/src/github.com/launchdarkly/go-client/flag.go](https://github.com/kpankonen/ld-daemon/blob/aec8718aea6cec2103705c3b629adca296d16477/Godeps/_workspace/src/github.com/launchdarkly/go-client/flag.go#L115-L126)

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 rule was used in a composite literal at line 122

[Click here to see the code in its original context.](https://github.com/kpankonen/ld-daemon/blob/aec8718aea6cec2103705c3b629adca296d16477/Godeps/_workspace/src/github.com/launchdarkly/go-client/flag.go#L115-L126)

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

```go
for _, rule := range f.Rules {
if rule.matchesUser(user) {
variation := rule.variationIndexForUser(user, f.Key, f.Salt)

if variation == nil {
return f.OffVariation, nil // TODO should this continue, or return the off variation?
} else {
explanation := Explanation{Kind: "rule", Rule: &rule}
return variation, &explanation
}
}
}

```

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: aec8718aea6cec2103705c3b629adca296d16477

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.