github-vet / github-vet/rangeloop-pointer-findings
gomberg5264/flynn2: blobstore/cleanup.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [gomberg5264/flynn2](https://www.github.com/gomberg5264/flynn2) at [blobstore/cleanup.go](https://github.com/gomberg5264/flynn2/blob/a5c70b2ae84be8ce9a3b54d68903c2b67051d01d/blobstore/cleanup.go#L46-L60)
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 55
[Click here to see the code in its original context.](https://github.com/gomberg5264/flynn2/blob/a5c70b2ae84be8ce9a3b54d68903c2b67051d01d/blobstore/cleanup.go#L46-L60)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for i, f := range files {
if f.Backend == nil {
log.Printf("[%d/%d] Skipping %s (%s) because backend is not configured", i+1, len(files), f.FileInfo.Name, f.ID)
continue
}
tokens <- struct{}{}
wg.Add(1)
go func(f data.BackendFile) {
if err := f.Backend.Delete(nil, f.FileInfo); err == nil {
log.Printf("[%d/%d] Successfully deleted %s (%s) from backend %s", i+1, len(files), f.FileInfo.Name, f.ID, f.Backend.Name())
}
<-tokens
wg.Done()
}(f)
}
```
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: a5c70b2ae84be8ce9a3b54d68903c2b67051d01d
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.