github-vet / github-vet/rangeloop-pointer-findings

lastbackend/lastbackend: pkg/api/types/v1/request/manifest.go; 6 LoC

Open
#18,057 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [lastbackend/lastbackend](https://www.github.com/lastbackend/lastbackend) at [pkg/api/types/v1/request/manifest.go](https://github.com/lastbackend/lastbackend/blob/356704814b6ef841b48fa550cd91e344be78303f/pkg/api/types/v1/request/manifest.go#L1335-L1340)

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 sv is reassigned at line 1338

[Click here to see the code in its original context.](https://github.com/lastbackend/lastbackend/blob/356704814b6ef841b48fa550cd91e344be78303f/pkg/api/types/v1/request/manifest.go#L1335-L1340)

Click here to show the 6 line(s) of Go which triggered the analyzer.

```go
for _, sv := range st.Volumes {
if v.Name == sv.Name {
f = true
spec = &sv
}
}

```

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: 356704814b6ef841b48fa550cd91e344be78303f

Contributor guide

No contributing guide indexed for this repository

Research direction

Read pkg/api/types/v1/request/manifest.go around lines 1335-1340 and inspect the surrounding request-manifest lookup. Check the reported range-loop reference in context, then determine whether the behavior is a Bug, Mitigated, or Desirable Behavior; done means recording that classification with a reaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.