github-vet / github-vet/rangeloop-pointer-findings
agrimrules/cncf: services/grpc/main.go; 3 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [agrimrules/cncf](https://www.github.com/agrimrules/cncf) at [services/grpc/main.go](https://github.com/agrimrules/cncf/blob/ce759de8d0cb70db9aaf123c04e24af510f40c4f/services/grpc/main.go#L80-L82)
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 p was used in a composite literal at line 81
[Click here to see the code in its original context.](https://github.com/agrimrules/cncf/blob/ce759de8d0cb70db9aaf123c04e24af510f40c4f/services/grpc/main.go#L80-L82)
Click here to show the 3 line(s) of Go which triggered the analyzer.
```go
for _, p := range posts {
stream.Send(&message.ListMessageResponse{Message: dataToPB(&p)})
}
```
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: ce759de8d0cb70db9aaf123c04e24af510f40c4f
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at services/grpc/main.go lines 80-82, where the gRPC response is built while ranging over posts, and inspect the pointer passed to dataToPB. Verify the analyzer finding and address it while preserving the intended response behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100