github-vet / github-vet/rangeloop-pointer-findings
devspace-cloud/devspace: e2e/tests/sync/sync.go; 34 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [devspace-cloud/devspace](https://www.github.com/devspace-cloud/devspace) at [e2e/tests/sync/sync.go](https://github.com/devspace-cloud/devspace/blob/09876340af417c1c44d7804beb7a072ce812d504/e2e/tests/sync/sync.go#L94-L127)
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 subTestName used in defer or goroutine at line 100
[Click here to see the code in its original context.](https://github.com/devspace-cloud/devspace/blob/09876340af417c1c44d7804beb7a072ce812d504/e2e/tests/sync/sync.go#L94-L127)
Click here to show the 34 line(s) of Go which triggered the analyzer.
```go
for _, subTestName := range subTests {
f.ResetLog()
c1 := make(chan error)
go func() {
err := func() error {
f.Namespace = utils.GenerateNamespaceName("test-sync-" + subTestName)
err := beforeTest(f)
defer afterTest(f)
if err != nil {
return errors.Errorf("test 'sync' failed: %s %v", f.GetLogContents(), err)
}
err = availableSubTests[subTestName](f, logger)
utils.PrintTestResult("sync", subTestName, err, logger)
if err != nil {
return errors.Errorf("test 'sync' failed: %s %v", f.GetLogContents(), err)
}
return nil
}()
c1 <- err
}()
select {
case err := <-c1:
if err != nil {
return err
}
case <-time.After(time.Duration(timeout) * time.Second):
return errors.Errorf("Timeout error - the test did not return within the specified timeout of %v seconds: %s", timeout, f.GetLogContents())
}
}
```
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: 09876340af417c1c44d7804beb7a072ce812d504
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.