github-vet / github-vet/rangeloop-pointer-findings
gambol99/embassy: proxy/endpoints/store.go; 7 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/store.go](https://github.com/gambol99/embassy/blob/dbb96cf058143e0e3148deee6756a3c85be08f25/proxy/endpoints/store.go#L136-L142)
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 139
[Click here to see the code in its original context.](https://github.com/gambol99/embassy/blob/dbb96cf058143e0e3148deee6756a3c85be08f25/proxy/endpoints/store.go#L136-L142)
Click here to show the 7 line(s) of Go which triggered the analyzer.
```go
for _, listener := range ds.listeners {
/* step: we run this in a go-routine not to block */
go func() {
glog.V(12).Infof("Pushing the event: %s to listener: %v", event, listener)
listener <- event
}()
}
```
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
Read proxy/endpoints/store.go at lines 136-142 and inspect how the listener value is used by the goroutine. Decide whether the analyzer's range-loop capture finding represents a bug, mitigation, or desirable behavior, then leave the corresponding reaction on this issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100