From 69ed22ac11be2018c4c34ca3cfb1082ee135573f Mon Sep 17 00:00:00 2001 From: Matt Fellows Date: Thu, 18 May 2017 15:34:56 +1000 Subject: [PATCH] chore(refactor): removed unused method GetFreePort --- protocol/tcp_test.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/protocol/tcp_test.go b/protocol/tcp_test.go index e320d54..f4cb78b 100644 --- a/protocol/tcp_test.go +++ b/protocol/tcp_test.go @@ -212,22 +212,6 @@ func waitForPort(port int, t *testing.T) { } } -// GetFreePort Gets an available port by asking the kernal for a random port -// ready and available for use. -func GetFreePort() int { - addr, err := net.ResolveTCPAddr("tcp", ":0") - if err != nil { - return 0 - } - - l, err := net.ListenTCP("tcp", addr) - if err != nil { - return 0 - } - defer l.Close() - return l.Addr().(*net.TCPAddr).Port -} - func TestTCPProxy_pipe(t *testing.T) { }