github-vet / github-vet/rangeloop-pointer-findings
IANTHEREAL/pbReader: transaltor.go; 16 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [IANTHEREAL/pbReader](https://www.github.com/IANTHEREAL/pbReader) at [transaltor.go](https://github.com/IANTHEREAL/pbReader/blob/6be498165cfaa3c1bb8441a7888678efcb8cdfe2/transaltor.go#L45-L60)
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 event is reassigned at line 46
[Click here to see the code in its original context.](https://github.com/IANTHEREAL/pbReader/blob/6be498165cfaa3c1bb8441a7888678efcb8cdfe2/transaltor.go#L45-L60)
Click here to show the 16 line(s) of Go which triggered the analyzer.
```go
for _, event := range dml.Events {
e := &event
outputEventHeader(e)
tp := e.GetTp()
row := e.GetRow()
switch tp {
case pb.EventType_Insert:
outputInsertAndDeleteEvent(row)
case pb.EventType_Update:
outputUpdateEvent(row)
case pb.EventType_Delete:
outputInsertAndDeleteEvent(row)
default:
panic("unreachable")
}
}
```
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: 6be498165cfaa3c1bb8441a7888678efcb8cdfe2
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.