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

wubo0067/calmwu-go: example/range_test/test.go; 3 LoC

Open
#14,757 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 [wubo0067/calmwu-go](https://www.github.com/wubo0067/calmwu-go) at [example/range_test/test.go](https://github.com/wubo0067/calmwu-go/blob/6ae76ffe4c3dd7f863635397ee8c42c898e9e9bf/example/range_test/test.go#L62-L64)

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 value is reassigned at line 63

[Click here to see the code in its original context.](https://github.com/wubo0067/calmwu-go/blob/6ae76ffe4c3dd7f863635397ee8c42c898e9e9bf/example/range_test/test.go#L62-L64)

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

```go
for i, value := range foo_lst {
foo2_lst[i] = &value
}

```

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: 6ae76ffe4c3dd7f863635397ee8c42c898e9e9bf

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect example/range_test/test.go at lines 62-64 and read the linked classification guidance for the analyzer finding. Determine whether the reference to the range variable is a Bug, Mitigated, or Desirable Behavior, then leave the corresponding reaction; completion is the classification reaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.