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

heiben-Frank/rust-hb: cli/state.go; 5 LoC

Open
#12,820 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 [heiben-Frank/rust-hb](https://www.github.com/heiben-Frank/rust-hb) at [cli/state.go](https://github.com/heiben-Frank/rust-hb/blob/80e6e56a824599e7b8a71241197a7dfa04d14cfc/cli/state.go#L1088-L1092)

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 l was used in a composite literal at line 1090

[Click here to see the code in its original context.](https://github.com/heiben-Frank/rust-hb/blob/80e6e56a824599e7b8a71241197a7dfa04d14cfc/cli/state.go#L1088-L1092)

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

```go
for _, l := range locs {
if l.Important() {
return &l
}
}

```

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: 80e6e56a824599e7b8a71241197a7dfa04d14cfc

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading cli/state.go at lines 1088-1092 in commit 80e6e56a824599e7b8a71241197a7dfa04d14cfc, focusing on the range-loop variable reference. Determine whether the analyzer finding represents a bug, mitigated behavior, or desirable behavior, then leave the corresponding reaction on this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.