github-vet / github-vet/rangeloop-pointer-findings
cloudfoundry-attic/bosh-softlayer-cpi-release-DEPRECATED-TO_BE_DELETED: src/bosh-softlayer-cpi/softlayer/virtual_guest_service/softlayer_ubuntu_net_manager.go; 19 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [cloudfoundry-attic/bosh-softlayer-cpi-release-DEPRECATED-TO_BE_DELETED](https://www.github.com/cloudfoundry-attic/bosh-softlayer-cpi-release-DEPRECATED-TO_BE_DELETED) at [src/bosh-softlayer-cpi/softlayer/virtual_guest_service/softlayer_ubuntu_net_manager.go](https://github.com/cloudfoundry-attic/bosh-softlayer-cpi-release-DEPRECATED-TO_BE_DELETED/blob/a288e9776532c8e3e1bc708d2ee808251d569f98/src/bosh-softlayer-cpi/softlayer/virtual_guest_service/softlayer_ubuntu_net_manager.go#L88-L106)
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 nw is reassigned at line 97
[Click here to see the code in its original context.](https://github.com/cloudfoundry-attic/bosh-softlayer-cpi-release-DEPRECATED-TO_BE_DELETED/blob/a288e9776532c8e3e1bc708d2ee808251d569f98/src/bosh-softlayer-cpi/softlayer/virtual_guest_service/softlayer_ubuntu_net_manager.go#L88-L106)
Click here to show the 19 line(s) of Go which triggered the analyzer.
```go
for _, nw := range networks {
if nw.Type != "dynamic" {
continue
}
if nw.CloudProperties.VlanID == *(networkComponents.PrimaryBackendNetworkComponent.NetworkVlan.Id) {
if privateDynamic != nil {
return nil, errors.New("multiple private dynamic networks are not supported")
}
privateDynamic = &nw
}
if nw.CloudProperties.VlanID == *(networkComponents.PrimaryNetworkComponent.NetworkVlan.Id) {
if publicDynamic != nil {
return nil, errors.New("multiple public dynamic networks are not supported")
}
publicDynamic = &nw
}
}
```
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: a288e9776532c8e3e1bc708d2ee808251d569f98
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.