github-vet / github-vet/rangeloop-pointer-findings
nuls-io/go-nuls: nuls-frame/cmd/cmd.go; 17 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [nuls-io/go-nuls](https://www.github.com/nuls-io/go-nuls) at [nuls-frame/cmd/cmd.go](https://github.com/nuls-io/go-nuls/blob/828cda9fcdbab6f21c2929d94885e677ccf330a2/nuls-frame/cmd/cmd.go#L51-L67)
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 c is reassigned at line 61
[Click here to see the code in its original context.](https://github.com/nuls-io/go-nuls/blob/828cda9fcdbab6f21c2929d94885e677ccf330a2/nuls-frame/cmd/cmd.go#L51-L67)
Click here to show the 17 line(s) of Go which triggered the analyzer.
```go
for _, c := range cmds {
if c.GetCmdInfo() == nil || c.GetCmdInfo().Name != cmdName {
continue
}
// 大版本不一样,跳过
// Big version is different, skip
if int(minVersion) != int(c.GetCmdInfo().Version) {
continue
}
if cmd == nil {
cmd = &c
continue
}
if c.GetCmdInfo().Version > (*cmd).GetCmdInfo().Version {
cmd = &c
}
}
```
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: 828cda9fcdbab6f21c2929d94885e677ccf330a2
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.