github-vet / rangeloop-pointer-findings

Issue tracker collects instances of Go code on GitHub that make use of references to range loop variables.
0 stars 0 forks source link

ovh/lhasa: api/v1/badge/repository.go; 8 LoC #18427

Open githubvet opened 3 years ago

githubvet commented 3 years ago

Found a possible issue in ovh/lhasa at api/v1/badge/repository.go

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 lvl is reassigned at line 145

Click here to see the code in its original context.

Click here to show the 8 line(s) of Go which triggered the analyzer. ```go for _, lvl := range levels { if lvl.ID == id { return &lvl, nil } if lvl.IsDefault { defaultLevel = &lvl } } ```

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 for more information.

commit ID: 6899a919ec2bb35e34d2178dbb9a2947ba472142