github-vet / github-vet/rangeloop-pointer-findings
gitteamer/tcp: server.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [gitteamer/tcp](https://www.github.com/gitteamer/tcp) at [server.go](https://github.com/gitteamer/tcp/blob/e4eb12b357d9cf81593285f25986cd1ca8856273/server.go#L159-L166)
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 connect used in defer or goroutine at line 162
[Click here to see the code in its original context.](https://github.com/gitteamer/tcp/blob/e4eb12b357d9cf81593285f25986cd1ca8856273/server.go#L159-L166)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for addr, connect := range s.connMgr {
go func() {
wg.Add(1)
connect.Close()
delete(s.connMgr, addr)
wg.Done()
}()
}
```
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: e4eb12b357d9cf81593285f25986cd1ca8856273
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with server.go lines 159-166 and inspect the reported range-loop variable use in the goroutine and defer-related analyzer warning. Compare the snippet with the linked classification descriptions, then leave the reaction that best identifies whether this is a bug, mitigated issue, or desirable behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100