github-vet / github-vet/rangeloop-pointer-findings
spetr/hidrelay: main.go; 8 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [spetr/hidrelay](https://www.github.com/spetr/hidrelay) at [main.go](https://github.com/spetr/hidrelay/blob/3ae40a0b5ed4a6890eafa9d59b374e1d4184bc97/main.go#L32-L39)
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 devInfo was used in a composite literal at line 37
[Click here to see the code in its original context.](https://github.com/spetr/hidrelay/blob/3ae40a0b5ed4a6890eafa9d59b374e1d4184bc97/main.go#L32-L39)
Click here to show the 8 line(s) of Go which triggered the analyzer.
```go
for _, devInfo := range hid.Enumerate(0x16C0, 0x05DF) {
relay, err := devInfo.Open()
if err != nil {
continue
}
list = append(list, &Relay{info: &devInfo})
relay.Close()
}
```
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: 3ae40a0b5ed4a6890eafa9d59b374e1d4184bc97
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.