github-vet / github-vet/rangeloop-pointer-findings
xiezhenye/mysql-relay-server: src/mysql_relay/util/barrier.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [xiezhenye/mysql-relay-server](https://www.github.com/xiezhenye/mysql-relay-server) at [src/mysql_relay/util/barrier.go](https://github.com/xiezhenye/mysql-relay-server/blob/e4eaaf1173f6d51ebb4df48ef3163a1f43bd983e/src/mysql_relay/util/barrier.go#L23-L30)
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 i used in defer or goroutine at line 28
[Click here to see the code in its original context.](https://github.com/xiezhenye/mysql-relay-server/blob/e4eaaf1173f6d51ebb4df48ef3163a1f43bd983e/src/mysql_relay/util/barrier.go#L23-L30)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for i, f := range self {
go func(f Joinable) {
errChan <- struct {
int
error
}{i, f()}
}(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: e4eaaf1173f6d51ebb4df48ef3163a1f43bd983e
Contributor guide
No contributing guide indexed for this repository
Research direction
Read src/mysql_relay/util/barrier.go at lines 23-30 and review the Go range-loop closure behavior described by the analyzer. Decide whether the reported capture is a bug, mitigated, or desirable behavior, then leave the corresponding reaction on the issue; no test or other entry point is mentioned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100