Skip to content

Commit 84321a0

Browse files
committed
Use JoinHostPort
1 parent b9f4d48 commit 84321a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

shared/services/connectivity/check-port-connectivity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func getPublicIP() (string, error) {
181181
// isPortReachableNATReflection attempts a TCP connection to host:port and returns true if
182182
// the connection succeeds within portCheckTimeout.
183183
func isPortReachableNATReflection(host string, port uint16) bool {
184-
address := fmt.Sprintf("%s:%d", host, port)
184+
address := net.JoinHostPort(host, fmt.Sprintf("%d", port))
185185
conn, err := net.DialTimeout("tcp", address, portCheckTimeout)
186186
if err != nil {
187187
return false

0 commit comments

Comments
 (0)