github-vet / github-vet/rangeloop-pointer-findings
smartrecruiters/rabbitr: cmd/commons/operation_executor.go; 23 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [smartrecruiters/rabbitr](https://www.github.com/smartrecruiters/rabbitr) at [cmd/commons/operation_executor.go](https://github.com/smartrecruiters/rabbitr/blob/4cfdea619103e14dddcc0da210e92167c2d0b715/cmd/commons/operation_executor.go#L59-L81)
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.
> function call which takes a reference to subject at line 68 may start a goroutine
[Click here to see the code in its original context.](https://github.com/smartrecruiters/rabbitr/blob/4cfdea619103e14dddcc0da210e92167c2d0b715/cmd/commons/operation_executor.go#L59-L81)
Click here to show the 23 line(s) of Go which triggered the analyzer.
```go
for _, subject := range *subjects {
start := time.Now()
parameters := make(map[string]interface{}, 1)
parameters[subjectOperator.Type] = subject
subjectMatches, err := matchExpression.Evaluate(parameters)
AbortIfError(err, fmt.Sprintf("Error evaluating following filter expression[%s] err: %s", filter, err))
if subjectMatches.(bool) {
if dryRun {
Fprintf(w, "Skipping %s operation: %s in dry-run mode\n", subjectOperator.Type, subjectOperator.GetName(&subject))
bar.Increment()
bar.DecoratorEwmaUpdate(time.Since(start))
continue
}
matchingSubjectsCount++
subjectOperator.ExecuteAction(client, &subject, w)
Fprintln(w)
}
bar.Increment()
// since ewma decorator is used, we need to pass time.Since(start)
bar.DecoratorEwmaUpdate(time.Since(start))
}
```
Click here to show extra information the analyzer produced.
```
The following dot graph describes paths through the callgraph that could lead to a function calling a goroutine:
no paths found; call may have ended in third-party code; stay tuned for diagnostics
```
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: 4cfdea619103e14dddcc0da210e92167c2d0b715
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.