github-vet / github-vet/rangeloop-pointer-findings
blackbeans/flume-bridge: consumer/log_source_manager.go; 29 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [blackbeans/flume-bridge](https://www.github.com/blackbeans/flume-bridge) at [consumer/log_source_manager.go](https://github.com/blackbeans/flume-bridge/blob/941e10822fd3b26627d2e51d7600262f3bc3f629/consumer/log_source_manager.go#L181-L209)
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 hp used in defer or goroutine at line 198
[Click here to see the code in its original context.](https://github.com/blackbeans/flume-bridge/blob/941e10822fd3b26627d2e51d7600262f3bc3f629/consumer/log_source_manager.go#L181-L209)
Click here to show the 29 line(s) of Go which triggered the analyzer.
```go
for _, hp := range flumenodes {
poollink, ok := self.hp2flumeClientPool[hp]
if !ok {
err, tmppool := pool.NewFlumePoolLink(hp)
if nil != err {
self.sourceManagerLog.Println("SOURCE_MANGER|INIT FLUMEPOOLLINE|FAIL|%s", err)
continue
}
poollink = tmppool
self.hp2flumeClientPool[hp] = poollink
}
defer func() {
if nil == poollink {
return
}
if err := recover(); nil != err {
self.sourceManagerLog.Printf("SOURCE_MANGER|CREATE FLUMECLIENT|FAIL|[%s]\n", hp)
poollink = nil
}
}()
if nil == poollink {
continue
}
poollink.AttachBusiness(business)
pools = append(pools, poollink)
}
```
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: 941e10822fd3b26627d2e51d7600262f3bc3f629
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.