github-vet / github-vet/rangeloop-pointer-findings
kabanero-io/events-operator: pkg/controller/eventmediator/eventmediator_controller.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [kabanero-io/events-operator](https://www.github.com/kabanero-io/events-operator) at [pkg/controller/eventmediator/eventmediator_controller.go](https://github.com/kabanero-io/events-operator/blob/88a3487acc952645902e80f98ea7ec8e2e9cb176/pkg/controller/eventmediator/eventmediator_controller.go#L805-L822)
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.
> reference to mediationsImpl is reassigned at line 806
[Click here to see the code in its original context.](https://github.com/kabanero-io/events-operator/blob/88a3487acc952645902e80f98ea7ec8e2e9cb176/pkg/controller/eventmediator/eventmediator_controller.go#L805-L822)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for _, mediationsImpl := range *mediator.Spec.Mediations {
eventMediationImpl := &mediationsImpl
err, matches, hasRepoType, repoTypeValue := mediationMatches(mediator, eventMediationImpl, event.Header , event.Body, path, env.Client, env.Namespace, event.RemoteAddr )
if err != nil {
klog.Infof("Error from mediationMatches for %v, error: %v", eventMediationImpl.Name, err)
return err
}
if matches {
/* process the message */
klog.Infof("Processing mediation %v hasRepoType: %v, repoTypeValue: %v", path, hasRepoType, repoTypeValue)
processor := eventcel.NewProcessor(generateEventFunctionLookupHandler(mediator),generateSendEventHandler(env, mediator, eventMediationImpl.Name) )
err := processor.ProcessMessage(event.Header, event.Body, mediator, eventMediationImpl, hasRepoType, repoTypeValue, env.Namespace, env.Client, env.KabaneroIntegration, event.RemoteAddr)
if err != nil {
klog.Errorf("Error processing mediation %v, error: %v", path, err)
}
return err
}
}
```
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: 88a3487acc952645902e80f98ea7ec8e2e9cb176
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.