github-vet / github-vet/rangeloop-pointer-findings
jkaiser/dedup_simulation: main/main.go; 22 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [jkaiser/dedup_simulation](https://www.github.com/jkaiser/dedup_simulation) at [main/main.go](https://github.com/jkaiser/dedup_simulation/blob/e969e6376f91326eb920d1618ebfa0f7260ac095/main/main.go#L549-L570)
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 generation used in defer or goroutine at line 564
[Click here to see the code in its original context.](https://github.com/jkaiser/dedup_simulation/blob/e969e6376f91326eb920d1618ebfa0f7260ac095/main/main.go#L549-L570)
Click here to show the 22 line(s) of Go which triggered the analyzer.
```go
for generation, fileInfoList := range traceDataSet.GetFileInfos() {
filePath := fileInfoList[0].Path
fileEntryChan := make(chan *algocommon.FileEntry, algocommon.ConstMaxFileEntries)
if traceReader == nil {
traceReader = algocommon.NewTraceDataReader(filePath)
} else {
traceReader.Reset(filePath)
}
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
algo.BeginTraceFile(generation, filePath)
go traceReader.FeedAlgorithm(fileEntryChan)
algo.HandleFiles(fileEntryChan, traceReader.GetFileEntryReturn())
algo.EndTraceFile(generation)
}()
wg.Wait()
}
```
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: e969e6376f91326eb920d1618ebfa0f7260ac095
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.