github-vet / github-vet/rangeloop-pointer-findings
cloud-ark/kubediscovery: pkg/discovery/discovery.go; 11 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [cloud-ark/kubediscovery](https://www.github.com/cloud-ark/kubediscovery) at [pkg/discovery/discovery.go](https://github.com/cloud-ark/kubediscovery/blob/0c6948734bf2633f02ecbdab542c8cdc3e4cf5cc/pkg/discovery/discovery.go#L445-L455)
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 comp is reassigned at line 448
[Click here to see the code in its original context.](https://github.com/cloud-ark/kubediscovery/blob/0c6948734bf2633f02ecbdab542c8cdc3e4cf5cc/pkg/discovery/discovery.go#L445-L455)
Click here to show the 11 line(s) of Go which triggered the analyzer.
```go
for i, comp := range cp.clusterCompositions {
if comp.Kind == compositions.Kind && comp.Name == compositions.Name && comp.Namespace == compositions.Namespace {
present = true
p := &comp
//fmt.Printf("CompositionTree:%v\n", compositionTree)
p.CompositionTree = compositionTree
p.Status = topLevelObject.Status
cp.clusterCompositions[i] = *p
//fmt.Printf("11 CP:%v\n", cp.clusterCompositions)
}
}
```
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: 0c6948734bf2633f02ecbdab542c8cdc3e4cf5cc
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.