github-vet / github-vet/rangeloop-pointer-findings
Xiaohao204/haochain: bill/vendor/github.com/hyperledger/fabric-sdk-go/pkg/fab/discovery/discovery.go; 14 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [Xiaohao204/haochain](https://www.github.com/Xiaohao204/haochain) at [bill/vendor/github.com/hyperledger/fabric-sdk-go/pkg/fab/discovery/discovery.go](https://github.com/Xiaohao204/haochain/blob/f78f818ef110e7e82787bee93deb8468cf1f0d7d/bill/vendor/github.com/hyperledger/fabric-sdk-go/pkg/fab/discovery/discovery.go#L66-L79)
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 target used in defer or goroutine at line 75
[Click here to see the code in its original context.](https://github.com/Xiaohao204/haochain/blob/f78f818ef110e7e82787bee93deb8468cf1f0d7d/bill/vendor/github.com/hyperledger/fabric-sdk-go/pkg/fab/discovery/discovery.go#L66-L79)
Click here to show the 14 line(s) of Go which triggered the analyzer.
```go
for _, target := range targets {
pconfig := target
go func() {
defer wg.Done()
resp, err := c.send(ctx, req, pconfig)
lock.Lock()
if err != nil {
errs = multi.Append(errs, errors.WithMessage(err, "From target: "+pconfig.URL))
} else {
responses = append(responses, &response{Response: resp, target: pconfig.URL})
}
lock.Unlock()
}()
}
```
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: f78f818ef110e7e82787bee93deb8468cf1f0d7d
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.