github-vet / github-vet/rangeloop-pointer-findings
flame0/cbr.ru: unpack.go; 10 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [flame0/cbr.ru](https://www.github.com/flame0/cbr.ru) at [unpack.go](https://github.com/flame0/cbr.ru/blob/2c340284dbb5e2adef3e65b282610b0cfd7d0318/unpack.go#L444-L453)
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 f used in defer or goroutine at line 449
[Click here to see the code in its original context.](https://github.com/flame0/cbr.ru/blob/2c340284dbb5e2adef3e65b282610b0cfd7d0318/unpack.go#L444-L453)
Click here to show the 10 line(s) of Go which triggered the analyzer.
```go
for _, f := range files {
guard <- struct{}{}
log.Println(f.Name())
wg.Add(1)
go func() {
unpackFile(f, db)
<-guard
wg.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: 2c340284dbb5e2adef3e65b282610b0cfd7d0318
Contributor guide
No contributing guide indexed for this repository
Research direction
Read unpack.go around lines 444-453 and inspect how the goroutine uses the range-loop variable f when calling unpackFile(f, db). Check the analyzer guidance linked in the issue and determine whether this is a Bug, Mitigated, or Desirable Behavior; completion is recording that classification with the corresponding reaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100