github-vet / github-vet/rangeloop-pointer-findings
j-c-levin/gdevelop-multiplayer-sample: Server/main/main.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [j-c-levin/gdevelop-multiplayer-sample](https://www.github.com/j-c-levin/gdevelop-multiplayer-sample) at [Server/main/main.go](https://github.com/j-c-levin/gdevelop-multiplayer-sample/blob/6189d9a5d1c84725e22e2e29cede0f45e07a2bb9/Server/main/main.go#L91-L98)
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 msg used in defer or goroutine at line 95
[Click here to see the code in its original context.](https://github.com/j-c-levin/gdevelop-multiplayer-sample/blob/6189d9a5d1c84725e22e2e29cede0f45e07a2bb9/Server/main/main.go#L91-L98)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for i, msg := range playerMap {
go func() {
// Mimic lag, sleep the code for 'lag' milliseconds
time.Sleep(time.Duration(lag) * time.Millisecond)
m.Broadcast(msg)
}()
delete(playerMap,i)
}
```
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: 6189d9a5d1c84725e22e2e29cede0f45e07a2bb9
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading Server/main/main.go lines 91-98 and the linked analyzer context. Determine whether the reported range-loop finding is a bug, mitigated, or desirable behavior, then leave the corresponding reaction; completion is a classification on the 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
- 30/100