github-vet / github-vet/rangeloop-pointer-findings
control-center/serviced: facade/service.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [control-center/serviced](https://www.github.com/control-center/serviced) at [facade/service.go](https://github.com/control-center/serviced/blob/61e9f80b20a46ac68d443636fc058107095e4e8f/facade/service.go#L3055-L3070)
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 d is reassigned at line 3056
[Click here to see the code in its original context.](https://github.com/control-center/serviced/blob/61e9f80b20a46ac68d443636fc058107095e4e8f/facade/service.go#L3055-L3070)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for _, d := range result {
p := &d
for i := 0; i < level; i++ {
p = p.Parent
if p == nil {
break
}
}
// If the parent name at this level matches OR this is the last
// segment and it matches the deployment ID, it's considered
// a match
if (p != nil && strings.ToLower(p.Name) == current) || (isEmptyPath(parent) && strings.ToLower(d.DeploymentID) == current) {
filtered = append(filtered, d)
}
}
```
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: 61e9f80b20a46ac68d443636fc058107095e4e8f
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.