github-vet / github-vet/rangeloop-pointer-findings
michaelhenkel/dmng: devicemanager.old/client/client.go; 39 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [michaelhenkel/dmng](https://www.github.com/michaelhenkel/dmng) at [devicemanager.old/client/client.go](https://github.com/michaelhenkel/dmng/blob/48f290ee3ffb2963732d6b6433ea34f8f143e3fa/devicemanager.old/client/client.go#L188-L226)
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 inputs used in defer or goroutine at line 192
[Click here to see the code in its original context.](https://github.com/michaelhenkel/dmng/blob/48f290ee3ffb2963732d6b6433ea34f8f143e3fa/devicemanager.old/client/client.go#L188-L226)
Click here to show the 39 line(s) of Go which triggered the analyzer.
```go
for server, inputs := range request {
s := connectionMap2[server]
done := make(chan bool)
go func() {
for _, input := range inputs {
switch input.Op {
case "create":
intfList := &dmPB.Interfaces{
Interface: input.Interfaces,
}
request := &dmPB.Request{
Request: &dmPB.Request_Create{
Create: &dmPB.Create{
CreateRequest: &dmPB.Create_Interfaces{
Interfaces: intfList,
},
},
},
}
log.Println("sending request")
//s.Request <- request
s.SendRquest(request)
fmt.Println("bla")
}
}
//close(done)
}()
go func() {
for {
select {
case result := <-s.Result:
log.Println("got result ", result)
default:
}
}
}()
<-done
}
```
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: 48f290ee3ffb2963732d6b6433ea34f8f143e3fa
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.