github-vet / github-vet/rangeloop-pointer-findings
ehcoin/EcoSystem-Health-Chain: hd/dispatcher.go; 14 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [ehcoin/EcoSystem-Health-Chain](https://www.github.com/ehcoin/EcoSystem-Health-Chain) at [hd/dispatcher.go](https://github.com/ehcoin/EcoSystem-Health-Chain/blob/67b75a5c54b332edb8cd4082564511de2ab89fd8/hd/dispatcher.go#L64-L77)
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 addr used in defer or goroutine at line 74
[Click here to see the code in its original context.](https://github.com/ehcoin/EcoSystem-Health-Chain/blob/67b75a5c54b332edb8cd4082564511de2ab89fd8/hd/dispatcher.go#L64-L77)
Click here to show the 14 line(s) of Go which triggered the analyzer.
```go
for _, addr := range nodes {
sendNode, err := ca.ConvertAddressToNodeId(addr)
if err != nil {
log.ERROR("SendToSignal", "ConvertAddressToNodeId err", err, "address", addr.Hex())
continue
}
log.INFO("SendToSignal", "address", addr.Hex(), "node id", sendNode)
go func() {
err := p2p.SendToSingle(sendNode, common.AlgorithmMsg, sendData)
if err != nil {
log.ERROR("SendToSignal", "address", addr.Hex(), "node id", sendNode, "err", err)
}
}()
}
```
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: 67b75a5c54b332edb8cd4082564511de2ab89fd8
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.