github-vet / github-vet/rangeloop-pointer-findings
makinj/go-le: internal/lifecycle/handle.go; 7 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [makinj/go-le](https://www.github.com/makinj/go-le) at [internal/lifecycle/handle.go](https://github.com/makinj/go-le/blob/fe6dcde54e4c8d8a7203458c8b84c62283ef8c4f/internal/lifecycle/handle.go#L25-L31)
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 err used in defer or goroutine at line 28
[Click here to see the code in its original context.](https://github.com/makinj/go-le/blob/fe6dcde54e4c8d8a7203458c8b84c62283ef8c4f/internal/lifecycle/handle.go#L25-L31)
Click here to show the 7 line(s) of Go which triggered the analyzer.
```go
for err := range h.errchan {
h.mu.Lock()
for _, sub := range h.errsubscribers {
go func() { sub <- err }()
}
h.mu.Unlock()
}
```
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: fe6dcde54e4c8d8a7203458c8b84c62283ef8c4f
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with internal/lifecycle/handle.go at lines 25-31 and inspect the surrounding lifecycle handling. Determine whether the reported range-loop use in the goroutine is a real issue, then record the appropriate classification when the behavior is understood.
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