github-vet / github-vet/rangeloop-pointer-findings
KongZ/phabrick: internal/handlers/webhook.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [KongZ/phabrick](https://www.github.com/KongZ/phabrick) at [internal/handlers/webhook.go](https://github.com/KongZ/phabrick/blob/2c945e580dc22ea15547a87c3368cace9586dde7/internal/handlers/webhook.go#L103-L118)
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.
> range-loop variable tran used in defer or goroutine at line 109
[Click here to see the code in its original context.](https://github.com/KongZ/phabrick/blob/2c945e580dc22ea15547a87c3368cace9586dde7/internal/handlers/webhook.go#L103-L118)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for _, tran := range transactions {
if tran.TransactionPHID == webhookReq.Transactions[0].Phid {
// actor
wg.Add(1)
go func() {
defer wg.Done()
users, err := con.QueryUser([]string{tran.AuthorPHID})
if err == nil {
actor = users[0]
} else {
log.Errorf("Error while quering PHID %s, %v", tran.AuthorPHID, err)
}
}()
break
}
}
```
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: 2c945e580dc22ea15547a87c3368cace9586dde7
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.