github-vet / github-vet/rangeloop-pointer-findings
gambol99/embassy: proxy/endpoints/marathon_endpoint.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [gambol99/embassy](https://www.github.com/gambol99/embassy) at [proxy/endpoints/marathon_endpoint.go](https://github.com/gambol99/embassy/blob/dbb96cf058143e0e3148deee6756a3c85be08f25/proxy/endpoints/marathon_endpoint.go#L198-L205)
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.
> range-loop variable listener used in defer or goroutine at line 202
[Click here to see the code in its original context.](https://github.com/gambol99/embassy/blob/dbb96cf058143e0e3148deee6756a3c85be08f25/proxy/endpoints/marathon_endpoint.go#L198-L205)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for service, listener := range r.services {
if strings.HasPrefix(service, event.AppID) {
glog.V(5).Infof("Marathon application: %s status updated, resyning now", event.AppID)
go func() {
listener <- true
}()
}
}
```
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: dbb96cf058143e0e3148deee6756a3c85be08f25
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading proxy/endpoints/marathon_endpoint.go at lines 198-205 and inspect how r.services and listener are used during the Marathon status update. Confirm whether the reported range-loop capture is a bug, mitigated, or desirable behavior, then classify the finding and document any needed correction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100