github-vet / github-vet/rangeloop-pointer-findings
kerinin/libring: cluster.go; 3 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [kerinin/libring](https://www.github.com/kerinin/libring) at [cluster.go](https://github.com/kerinin/libring/blob/7ef0f706c6b5db962d1faa8d56662d67799b481b/cluster.go#L174-L176)
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 member is reassigned at line 175
[Click here to see the code in its original context.](https://github.com/kerinin/libring/blob/7ef0f706c6b5db962d1faa8d56662d67799b481b/cluster.go#L174-L176)
Click here to show the 3 line(s) of Go which triggered the analyzer.
```go
for _, member := range e.(serf.MemberEvent).Members {
c.memberMap[member.Name] = &member
}
```
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: 7ef0f706c6b5db962d1faa8d56662d67799b481b
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with cluster.go lines 174-176 and the linked code context. Read the surrounding MemberEvent handling to determine whether storing a pointer to the range variable in memberMap is safe, then inspect any available tests or add a focused regression check. Done means confirming the analyzer finding and documenting whether it is a bug, mitigated, or desirable behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100