github-vet / github-vet/rangeloop-pointer-findings
staaldraad/ssh-git-go: main.go; 19 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [staaldraad/ssh-git-go](https://www.github.com/staaldraad/ssh-git-go) at [main.go](https://github.com/staaldraad/ssh-git-go/blob/ac6aadc658281404fecbbd57249a03e7cb0ba515/main.go#L113-L131)
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 req used in defer or goroutine at line 123
[Click here to see the code in its original context.](https://github.com/staaldraad/ssh-git-go/blob/ac6aadc658281404fecbbd57249a03e7cb0ba515/main.go#L113-L131)
Click here to show the 19 line(s) of Go which triggered the analyzer.
```go
for req := range requests {
// only going to respond to exec.
// and then only to git-upload-pack
if req.Type == "exec" {
if req.WantReply {
req.Reply(true, []byte{})
}
go func() {
handleExecChannel(channel, req)
channel.Close()
}()
} else {
if req.WantReply {
req.Reply(false, nil)
}
}
}
```
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: ac6aadc658281404fecbbd57249a03e7cb0ba515
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.