github-vet / github-vet/rangeloop-pointer-findings
iKuiki/wwdk: getinfo.go; 11 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [iKuiki/wwdk](https://www.github.com/iKuiki/wwdk) at [getinfo.go](https://github.com/iKuiki/wwdk/blob/25b10de79782984c3f97755000ab9030e5536fa9/getinfo.go#L30-L40)
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 c was used in a composite literal at line 36
[Click here to see the code in its original context.](https://github.com/iKuiki/wwdk/blob/25b10de79782984c3f97755000ab9030e5536fa9/getinfo.go#L30-L40)
Click here to show the 11 line(s) of Go which triggered the analyzer.
```go
for _, c := range contactList {
wxwb.userInfo.contactList[c.UserName] = c
if c.UserName == username {
wxwb.logger.Infof("User %s not found, but BatchGetContact got that", c.NickName)
wxwb.syncChannel <- SyncChannelItem{
Code: SyncStatusModifyContact,
Contact: &c,
}
contact, ok = c, true
}
}
```
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: 25b10de79782984c3f97755000ab9030e5536fa9
Contributor guide
No contributing guide indexed for this repository
Research direction
Read getinfo.go lines 30-40 at commit 25b10de79782984c3f97755000ab9030e5536fa9, focusing on the range loop and the reference used in the composite literal. Compare the analyzer finding with the linked code context, then classify the instance as Bug, Mitigated, or Desirable Behavior using the requested reaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100