github-vet / github-vet/rangeloop-pointer-findings
SpectraLogic/ds3_go_sdk: ds3_cli/commands/bulk.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [SpectraLogic/ds3_go_sdk](https://www.github.com/SpectraLogic/ds3_go_sdk) at [ds3_cli/commands/bulk.go](https://github.com/SpectraLogic/ds3_go_sdk/blob/3e666133cc73db44b082d63119da636681fa1625/ds3_cli/commands/bulk.go#L12-L27)
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 objectList used in defer or goroutine at line 15
[Click here to see the code in its original context.](https://github.com/SpectraLogic/ds3_go_sdk/blob/3e666133cc73db44b082d63119da636681fa1625/ds3_cli/commands/bulk.go#L12-L27)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for _, objectList := range objectLists {
go func() {
// Loop over each object and call the bulk handler.
for _, obj := range objectList.Objects {
// If there was an error, pass it onto the error channel and
// terminate the goroutine.
if err := objectHandler(obj); err != nil {
finish <- err
return
}
}
// Signal that the object list is done.
finish <- nil
}()
}
```
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: 3e666133cc73db44b082d63119da636681fa1625
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with ds3_cli/commands/bulk.go lines 12-27 and inspect how the goroutine uses each range-loop objectList. Determine whether the captured value can cause incorrect bulk handling, then classify the finding as Bug, Mitigated, or Desirable Behavior as requested; done means the classification is supported by the code’s behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100