github-vet / github-vet/rangeloop-pointer-findings
alexandregv/Frozen: src/main.go; 20 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [alexandregv/Frozen](https://www.github.com/alexandregv/Frozen) at [src/main.go](https://github.com/alexandregv/Frozen/blob/f392d4a023c74b1d5bcf82e2b2416ba490f71f27/src/main.go#L19-L38)
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.
> reference to e is reassigned at line 33
[Click here to see the code in its original context.](https://github.com/alexandregv/Frozen/blob/f392d4a023c74b1d5bcf82e2b2416ba490f71f27/src/main.go#L19-L38)
Click here to show the 20 line(s) of Go which triggered the analyzer.
```go
for _, e := range servers {
e.start()
current_servers = append(current_servers, &e)
defer e.listener.Close() // At function end, stop server
for {
c, err := e.listener.Accept()
if err != nil {
fmt.Println("err", err)
return
}
conn := connection{conn: c, addr: c.RemoteAddr().String()}
conn.session = &user{}
conn.server = &e
current_connections = append(current_connections, &conn)
home_channel.subscribed_users = append(home_channel.subscribed_users, conn.session)
go conn.handler()
}
}
```
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: f392d4a023c74b1d5bcf82e2b2416ba490f71f27
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.