github-vet / github-vet/rangeloop-pointer-findings
konveyor/mig-controller: pkg/controller/migplan/storage.go; 42 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [konveyor/mig-controller](https://www.github.com/konveyor/mig-controller) at [pkg/controller/migplan/storage.go](https://github.com/konveyor/mig-controller/blob/cf705e01f0dac48c3a557d61d98776b54b6c3420/pkg/controller/migplan/storage.go#L38-L79)
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 cluster was used in a composite literal at line 48
[Click here to see the code in its original context.](https://github.com/konveyor/mig-controller/blob/cf705e01f0dac48c3a557d61d98776b54b6c3420/pkg/controller/migplan/storage.go#L38-L79)
Click here to show the 42 line(s) of Go which triggered the analyzer.
```go
for _, cluster := range clusters {
if !cluster.Status.IsReady() {
continue
}
client, err = cluster.GetClient(r)
if err != nil {
return liberr.Wrap(err)
}
pl := PlanStorage{
Client: r,
targetCluster: &cluster,
targetClient: client,
storage: storage,
plan: plan,
}
// BSL
err := pl.ensureBSL()
if err != nil {
return liberr.Wrap(err)
}
// VSL
err = pl.ensureVSL()
if err != nil {
return liberr.Wrap(err)
}
// BSL Cloud Secret
err = pl.ensureBSLCloudSecret()
if err != nil {
return liberr.Wrap(err)
}
// VSL Cloud Secret
err = pl.ensureVSLCloudSecret()
if err != nil {
return liberr.Wrap(err)
}
nEnsured++
}
```
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: cf705e01f0dac48c3a557d61d98776b54b6c3420
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.