go1.8: Changes to support golang 1.8 (#4759)

QuirkConn is added to replace net.Conn as a workaround to a golang bug:
https://github.com/golang/go/issues/21133
This commit is contained in:
A. Elleuch
2017-08-06 19:27:33 +01:00
committed by Harshavardhana
parent 218049300c
commit b4dc6df35c
14 changed files with 96 additions and 59 deletions

View File

@@ -223,7 +223,7 @@ func TestCheckLocalServerAddr(t *testing.T) {
{"localhost:54321", nil},
{"0.0.0.0:9000", nil},
{"", fmt.Errorf("missing port in address")},
{"localhost", fmt.Errorf("missing port in address localhost")},
{"localhost", fmt.Errorf("address localhost: missing port in address")},
{"example.org:54321", fmt.Errorf("host in server address should be this server")},
{":0", fmt.Errorf("port number must be between 1 to 65535")},
{":-10", fmt.Errorf("port number must be between 1 to 65535")},
@@ -251,7 +251,6 @@ func TestExtractHostPort(t *testing.T) {
expectedErr error
}{
{"", "", "", errors.New("unable to process empty address")},
{"localhost", "localhost", "80", nil},
{"localhost:9000", "localhost", "9000", nil},
{"http://:9000/", "", "9000", nil},
{"http://8.8.8.8:9000/", "8.8.8.8", "9000", nil},
@@ -294,7 +293,9 @@ func TestSameLocalAddrs(t *testing.T) {
{":9000", ":9000", true, nil},
{"localhost:9000", ":9000", true, nil},
{"localhost:9000", "http://localhost:9000", true, nil},
{"8.8.8.8:9000", "http://localhost:9000", false, nil},
{"http://localhost:9000", ":9000", true, nil},
{"http://localhost:9000", "http://localhost:9000", true, nil},
{"http://8.8.8.8:9000", "http://localhost:9000", false, nil},
}
for i, testCase := range testCases {