github-vet / github-vet/rangeloop-pointer-findings
omrikiei/ktunnel: cmd/expose.go; 21 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [omrikiei/ktunnel](https://www.github.com/omrikiei/ktunnel) at [cmd/expose.go](https://github.com/omrikiei/ktunnel/blob/de0721984b6664426e0c5ae96a215c8670466cb2/cmd/expose.go#L78-L98)
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 srcPort used in defer or goroutine at line 80
[Click here to see the code in its original context.](https://github.com/omrikiei/ktunnel/blob/de0721984b6664426e0c5ae96a215c8670466cb2/cmd/expose.go#L78-L98)
Click here to show the 21 line(s) of Go which triggered the analyzer.
```go
for _, srcPort := range *sourcePorts {
go func() {
p, err := strconv.ParseInt(srcPort, 10, 0)
if err != nil {
log.Fatalf("Failed to run client: %v", err)
}
prt := int(p)
opts := []client.ClientOption{
client.WithServer(Host, prt),
client.WithTunnels(Scheme, ports...),
client.WithLogger(&logger),
}
if tls {
opts = append(opts, client.WithTLS(CertFile, ServerHostOverride))
}
err = client.RunClient(ctx, opts...)
if err != nil {
log.Fatalf("Failed to run client: %v", err)
}
}()
}
```
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: de0721984b6664426e0c5ae96a215c8670466cb2
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.