From: Michael Stapelberg Date: Tue, 1 Dec 2015 21:25:27 +0000 (+0100) Subject: tcp_test: fix failing net.Listen by specifying :0 as port X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7091c159b3f4af92aaae445d058cd1c128399809;p=blackbox_exporter.git tcp_test: fix failing net.Listen by specifying :0 as port --- diff --git a/tcp_test.go b/tcp_test.go index 9d4ddfd..9243e71 100644 --- a/tcp_test.go +++ b/tcp_test.go @@ -20,7 +20,7 @@ import ( ) func TestTCPConnection(t *testing.T) { - ln, err := net.Listen("tcp", "localhost:") + ln, err := net.Listen("tcp", "localhost:0") if err != nil { t.Fatalf("Error listening on socket: %s", err) }