github-vet / github-vet/rangeloop-pointer-findings
vasilax/atlantis15: server/events/vcs/github_client.go; 7 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [vasilax/atlantis15](https://www.github.com/vasilax/atlantis15) at [server/events/vcs/github_client.go](https://github.com/vasilax/atlantis15/blob/270ebbe87a2f69150bd769f5c985f25ff1a5bc2c/server/events/vcs/github_client.go#L155-L161)
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 157
[Click here to see the code in its original context.](https://github.com/vasilax/atlantis15/blob/270ebbe87a2f69150bd769f5c985f25ff1a5bc2c/server/events/vcs/github_client.go#L155-L161)
Click here to show the 7 line(s) of Go which triggered the analyzer.
```go
for _, c := range comments {
g.logger.Debug("POST /repos/%v/%v/issues/%d/comments", repo.Owner, repo.Name, pullNum)
_, _, err := g.client.Issues.CreateComment(g.ctx, repo.Owner, repo.Name, pullNum, &github.IssueComment{Body: &c})
if err != nil {
return err
}
}
```
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: 270ebbe87a2f69150bd769f5c985f25ff1a5bc2c
Contributor guide
No contributing guide indexed for this repository
Research direction
Open server/events/vcs/github_client.go around lines 155-161 and inspect the range over comments together with the Issues.CreateComment call. Check the analyzer warning about the reference to c, then verify the behavior with the repository's available tests or checks. Done means the comment creation loop no longer has the reported range-variable reference issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100