Skip to content

Commit

Permalink
Gateway.LocalPortInt: Use strconv.Atoi
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicious committed Apr 12, 2022
1 parent 0437882 commit d60bf57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/teleterm/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"crypto/tls"
"fmt"
"net"
"strconv"

alpn "github.com/gravitational/teleport/lib/srv/alpnproxy"
alpncommon "github.com/gravitational/teleport/lib/srv/alpnproxy/common"
Expand Down Expand Up @@ -124,7 +125,7 @@ func (g *Gateway) LocalPortInt() int {
// Ignoring the error here as Teleterm doesn't allow the user to pick the value for the port, so
// it'll always be a random integer value, not a service name that needs actual lookup.
// For more details, see https://stackoverflow.com/questions/47992477/why-is-port-a-string-and-not-an-integer
port, _ := net.LookupPort("", g.LocalPort)
port, _ := strconv.Atoi(g.LocalPort)
return port
}

Expand Down

0 comments on commit d60bf57

Please sign in to comment.