github-vet / github-vet/rangeloop-pointer-findings
jmccann/drone-github-status: plugin/plugin.go; 20 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [jmccann/drone-github-status](https://www.github.com/jmccann/drone-github-status) at [plugin/plugin.go](https://github.com/jmccann/drone-github-status/blob/46b496d6b89fa415a9414d196485f82f5b79750c/plugin/plugin.go#L86-L105)
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 is reassigned at line 87
[Click here to see the code in its original context.](https://github.com/jmccann/drone-github-status/blob/46b496d6b89fa415a9414d196485f82f5b79750c/plugin/plugin.go#L86-L105)
Click here to show the 20 line(s) of Go which triggered the analyzer.
```go
for _, c := range p.Contexts {
status.Context = &c
logrus.WithFields(logrus.Fields{
"build-status": p.BuildStatus,
"calculated-state": state,
"context": c,
"description": p.Description,
"repo-name": p.RepoName,
"repo-owner": p.RepoOwner,
"sha": p.CommitSHA,
"state": p.State,
"target-url": p.TargetURL,
}).Debug("creating status")
_, _, err := p.gitClient.Repositories.CreateStatus(p.gitContext, p.RepoOwner, p.RepoName, p.CommitSHA, status)
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: 46b496d6b89fa415a9414d196485f82f5b79750c
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.