tcp_test: fix failing net.Listen by specifying :0 as port
authorMichael Stapelberg <stapelberg@google.com>
Tue, 1 Dec 2015 21:25:27 +0000 (22:25 +0100)
committerMichael Stapelberg <stapelberg@google.com>
Tue, 1 Dec 2015 21:26:04 +0000 (22:26 +0100)
tcp_test.go

index 9d4ddfdcc16401d3529abe4831137d030943c82e..9243e71673cd6185ec55c3b6cd4d30710a811160 100644 (file)
@@ -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)
        }