github-vet / github-vet/rangeloop-pointer-findings

lysu/thriftpool-go: thriftgen/thriftpool.go; 5 LoC

Open
#15,641 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [lysu/thriftpool-go](https://www.github.com/lysu/thriftpool-go) at [thriftgen/thriftpool.go](https://github.com/lysu/thriftpool-go/blob/ff63b64ce2e479162fb621bb5f38b32b6ca3c921/thriftgen/thriftpool.go#L134-L138)

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 f is reassigned at line 136

[Click here to see the code in its original context.](https://github.com/lysu/thriftpool-go/blob/ff63b64ce2e479162fb621bb5f38b32b6ca3c921/thriftgen/thriftpool.go#L134-L138)

Click here to show the 5 line(s) of Go which triggered the analyzer.

```go
for _, f := range functions {
if f.Name == "Ping" && len(f.Params) == 0 && len(f.Res) == 1 && f.Res[0].Type == "error" {
pingFunc = &f
}
}

```

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: ff63b64ce2e479162fb621bb5f38b32b6ca3c921

Contributor guide

No contributing guide indexed for this repository

Research direction

Read thriftgen/thriftpool.go around lines 134-138, then inspect the surrounding uses of pingFunc to understand the reported reassignment. Done means deciding whether the analyzer finding is a Bug, Mitigated, or Desirable Behavior and leaving the corresponding reaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.