github-vet / github-vet/rangeloop-pointer-findings
Xiang-Shi/PStream: example/client_browse_deptree/main.go; 12 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [Xiang-Shi/PStream](https://www.github.com/Xiang-Shi/PStream) at [example/client_browse_deptree/main.go](https://github.com/Xiang-Shi/PStream/blob/c1eea1bd63229d3d9f21934c7a85e907e3e133df/example/client_browse_deptree/main.go#L429-L440)
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 comp used in defer or goroutine at line 436
[Click here to see the code in its original context.](https://github.com/Xiang-Shi/PStream/blob/c1eea1bd63229d3d9f21934c7a85e907e3e133df/example/client_browse_deptree/main.go#L429-L440)
Click here to show the 12 line(s) of Go which triggered the analyzer.
```go
for _, comp := range o.Comps {
if comp.ID == dep.A2 {
wg.Add(1)
go func(o *Obj) {
defer wg.Done()
ok := checkDependedActivities(o.Download.ID)
if ok {
compute(o, comp)
}
}(o)
}
}
```
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: c1eea1bd63229d3d9f21934c7a85e907e3e133df
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect example/client_browse_deptree/main.go around lines 429-440, focusing on the range-loop variable used by the goroutine and the call to compute. Compare the analyzer finding with the linked classification descriptions, then leave the appropriate reaction on this issue; done means the finding is classified as Bug, Mitigated, or Desirable Behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100