github-vet / github-vet/rangeloop-pointer-findings
rancher/cli: cmd/cluster.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [rancher/cli](https://www.github.com/rancher/cli) at [cmd/cluster.go](https://github.com/rancher/cli/blob/85998abbe86fe7ac990f38081cbe499f4bc2042a/cmd/cluster.go#L227-L244)
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 item was used in a composite literal at line 237
[Click here to see the code in its original context.](https://github.com/rancher/cli/blob/85998abbe86fe7ac990f38081cbe499f4bc2042a/cmd/cluster.go#L227-L244)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for _, item := range collection.Data {
var current string
if item.ID == c.UserConfig.FocusedCluster() {
current = "*"
}
writer.Write(&ClusterData{
ID: item.ID,
Current: current,
Cluster: item,
Name: getClusterName(&item),
Provider: getClusterProvider(item),
Nodes: item.NodeCount,
CPU: getClusterCPU(item),
RAM: getClusterRAM(item),
Pods: getClusterPods(item),
})
}
```
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: 85998abbe86fe7ac990f38081cbe499f4bc2042a
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.