github-vet / github-vet/rangeloop-pointer-findings
ldaysjun/EveryDayLeetCode: 15.go; 3 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [ldaysjun/EveryDayLeetCode](https://www.github.com/ldaysjun/EveryDayLeetCode) at [15.go](https://github.com/ldaysjun/EveryDayLeetCode/blob/dc87161eb897817bb5ff88ff5b7b29dff38b3c84/15.go#L22-L24)
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 23
[Click here to see the code in its original context.](https://github.com/ldaysjun/EveryDayLeetCode/blob/dc87161eb897817bb5ff88ff5b7b29dff38b3c84/15.go#L22-L24)
Click here to show the 3 line(s) of Go which triggered the analyzer.
```go
for index, value := range slice {
myMap[index] = &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: dc87161eb897817bb5ff88ff5b7b29dff38b3c84
Contributor guide
No contributing guide indexed for this repository
Research direction
Read 15.go at lines 22–24 in commit dc87161eb897817bb5ff88ff5b7b29dff38b3c84 and inspect how the range loop uses value. Compare the analyzer finding with the surrounding code, then classify the report by leaving the appropriate reaction; completion is the selected classification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100