github-vet / github-vet/rangeloop-pointer-findings
wlan0/rancher-mesos-scheduler: Godeps/_workspace/src/github.com/rancher/go-machine-service/events/listener.go; 40 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [wlan0/rancher-mesos-scheduler](https://www.github.com/wlan0/rancher-mesos-scheduler) at [Godeps/_workspace/src/github.com/rancher/go-machine-service/events/listener.go](https://github.com/wlan0/rancher-mesos-scheduler/blob/893fb602d3d04c8d0af2e27f61472e94875bf8f3/Godeps/_workspace/src/github.com/rancher/go-machine-service/events/listener.go#L275-L314)
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 handler is reassigned at line 276
[Click here to see the code in its original context.](https://github.com/wlan0/rancher-mesos-scheduler/blob/893fb602d3d04c8d0af2e27f61472e94875bf8f3/Godeps/_workspace/src/github.com/rancher/go-machine-service/events/listener.go#L275-L314)
Click here to show the 40 line(s) of Go which triggered the analyzer.
```go
for _, handler := range handlers.Data {
h := &handler
log.WithFields(log.Fields{
"handlerId": h.Id,
}).Debug("Removing old handler")
doneTransitioning := func() (bool, error) {
h, err := apiClient.ExternalHandler.ById(h.Id)
if err != nil {
return false, err
}
return h.Transitioning != "yes", nil
}
if _, ok := h.Actions["deactivate"]; ok {
h, err = apiClient.ExternalHandler.ActionDeactivate(h)
if err != nil {
return err
}
err = waitForTransition(doneTransitioning)
if err != nil {
return err
}
}
h, err := apiClient.ExternalHandler.ById(h.Id)
if err != nil {
return err
}
if _, ok := h.Actions["remove"]; ok {
h, err = apiClient.ExternalHandler.ActionRemove(h)
if err != nil {
return err
}
err = waitForTransition(doneTransitioning)
if err != nil {
return err
}
}
}
```
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: 893fb602d3d04c8d0af2e27f61472e94875bf8f3
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.