github-vet / github-vet/rangeloop-pointer-findings
velann21/velero: pkg/cmd/cli/restore/describe.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [velann21/velero](https://www.github.com/velann21/velero) at [pkg/cmd/cli/restore/describe.go](https://github.com/velann21/velero/blob/00303b18febd197600d551cf1a7ea0acbcfafb10/pkg/cmd/cli/restore/describe.go#L67-L81)
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.
> reference to restore was used in a composite literal at line 74
[Click here to see the code in its original context.](https://github.com/velann21/velero/blob/00303b18febd197600d551cf1a7ea0acbcfafb10/pkg/cmd/cli/restore/describe.go#L67-L81)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for _, restore := range restores.Items {
opts := restic.NewPodVolumeRestoreListOptions(restore.Name)
podvolumeRestoreList, err := veleroClient.VeleroV1().PodVolumeRestores(f.Namespace()).List(opts)
if err != nil {
fmt.Fprintf(os.Stderr, "error getting PodVolumeRestores for restore %s: %v\n", restore.Name, err)
}
s := output.DescribeRestore(&restore, podvolumeRestoreList.Items, details, veleroClient, insecureSkipTLSVerify, caCertFile)
if first {
first = false
fmt.Print(s)
} else {
fmt.Printf("\n\n%s", s)
}
}
```
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: 00303b18febd197600d551cf1a7ea0acbcfafb10
Contributor guide
No contributing guide indexed for this repository
Research direction
Read pkg/cmd/cli/restore/describe.go at lines 67-81 and review the Go range-loop reference shown in the analyzer report. Check the surrounding restore description flow and any relevant project context, then react to the issue with the appropriate Bug, Mitigated, or Desirable Behavior classification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100