github-vet / github-vet/rangeloop-pointer-findings
kvij/wsevents: wsevents.go; 6 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [kvij/wsevents](https://www.github.com/kvij/wsevents) at [wsevents.go](https://github.com/kvij/wsevents/blob/6cd6f621db1b3855ac59ae736e8ad51b7a013adc/wsevents.go#L65-L70)
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 channel used in defer or goroutine at line 67
[Click here to see the code in its original context.](https://github.com/kvij/wsevents/blob/6cd6f621db1b3855ac59ae736e8ad51b7a013adc/wsevents.go#L65-L70)
Click here to show the 6 line(s) of Go which triggered the analyzer.
```go
for _, channel := range channels {
go func() {
channel <- pack
//Fixme: handle closed channels e.g. unregisterd event handlers
}()
}
```
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: 6cd6f621db1b3855ac59ae736e8ad51b7a013adc
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with wsevents.go lines 65-70 at commit 6cd6f621db1b3855ac59ae736e8ad51b7a013adc. Read the range loop and goroutine context, then determine whether the captured channel produces incorrect behavior. Done means leaving the appropriate classification reaction on the issue after checking the analyzer guidance.
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
- Clearly specified
- Newbie friendliness
- 35/100