github-vet / github-vet/rangeloop-pointer-findings
dasJ/versioncheck: notificator/notificator.go; 26 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [dasJ/versioncheck](https://www.github.com/dasJ/versioncheck) at [notificator/notificator.go](https://github.com/dasJ/versioncheck/blob/39755de36fd2804ff7648656ba1fb708461499c0/notificator/notificator.go#L16-L41)
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 item used in defer or goroutine at line 20
[Click here to see the code in its original context.](https://github.com/dasJ/versioncheck/blob/39755de36fd2804ff7648656ba1fb708461499c0/notificator/notificator.go#L16-L41)
Click here to show the 26 line(s) of Go which triggered the analyzer.
```go
for _, item := range res.Changed {
wait.Add(1)
go func() {
args := []string{
item.Name,
item.Module,
item.OldVersion,
item.NewVersion,
}
args = append(args, item.Tags...)
cmd := exec.Command(cfg.Notificator, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Start()
if err != nil {
fmt.Printf("%s\n", err)
wait.Done()
return
}
err = cmd.Wait()
if err != nil {
fmt.Printf("%s\n", err)
}
wait.Done()
}()
}
```
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: 39755de36fd2804ff7648656ba1fb708461499c0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.