github-vet / github-vet/rangeloop-pointer-findings
diamondburned/6cord: command.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [diamondburned/6cord](https://www.github.com/diamondburned/6cord) at [command.go](https://github.com/diamondburned/6cord/blob/aa7acec12ede7cda4c4bdc0b1775f71ff949e9e3/command.go#L152-L166)
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 cmd used in defer or goroutine at line 161
[Click here to see the code in its original context.](https://github.com/diamondburned/6cord/blob/aa7acec12ede7cda4c4bdc0b1775f71ff949e9e3/command.go#L152-L166)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for _, cmd := range commands {
if f[0] == cmd.Command && cmd.Function != nil {
go func() {
defer func() {
if r := recover(); r != nil {
Warn(fmt.Sprintf("%v", r))
}
}()
cmd.Function(f)
}()
return
}
}
```
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: aa7acec12ede7cda4c4bdc0b1775f71ff949e9e3
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.