github-vet / github-vet/rangeloop-pointer-findings
jeffdoubleyou/ubiq-explorer: daemon/blockdaemon.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [jeffdoubleyou/ubiq-explorer](https://www.github.com/jeffdoubleyou/ubiq-explorer) at [daemon/blockdaemon.go](https://github.com/jeffdoubleyou/ubiq-explorer/blob/e2389f8da83b5d14ba851e6dc722f31173cb8685/daemon/blockdaemon.go#L161-L175)
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 tokenTransaction used in defer or goroutine at line 163
[Click here to see the code in its original context.](https://github.com/jeffdoubleyou/ubiq-explorer/blob/e2389f8da83b5d14ba851e6dc722f31173cb8685/daemon/blockdaemon.go#L161-L175)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for _, tokenTransaction := range tokenTransactions {
go func() {
_, err := tokenDAO.InsertTokenTransaction(*tokenTransaction)
if err != nil {
log.Fatalf("Failed to insert token transaction: %s", err)
run = 0
}
}()
if _, e := tokenAddresses[tokenTransaction.From.String()]; !e {
tokenAddresses[tokenTransaction.From.String()] = tokenTransaction.From
}
if _, e := tokenAddresses[tokenTransaction.To.String()]; !e {
tokenAddresses[tokenTransaction.To.String()] = tokenTransaction.To
}
}
```
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: e2389f8da83b5d14ba851e6dc722f31173cb8685
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.