github-vet / github-vet/rangeloop-pointer-findings
uber/zanzibar: codegen/module.go; 11 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [uber/zanzibar](https://www.github.com/uber/zanzibar) at [codegen/module.go](https://github.com/uber/zanzibar/blob/d266f46b0e6ffc9ac0cfe6b008d8525afac8e389/codegen/module.go#L1302-L1312)
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 i used in defer or goroutine at line 1308
[Click here to see the code in its original context.](https://github.com/uber/zanzibar/blob/d266f46b0e6ffc9ac0cfe6b008d8525afac8e389/codegen/module.go#L1302-L1312)
Click here to show the 11 line(s) of Go which triggered the analyzer.
```go
for i, hook := range system.postGenHook {
if hook != nil {
wg.Add(1)
go func(hook PostGenHook) {
defer wg.Done()
if err := hook(toBeBuiltModules); err != nil {
ch <- errors.Wrapf(err, "error running %dth post generation hook", i)
}
}(hook)
}
}
```
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: d266f46b0e6ffc9ac0cfe6b008d8525afac8e389
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.