fix ipv6 addr parsing and using
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
		| @@ -2,14 +2,16 @@ package transport | ||||
|  | ||||
| import ( | ||||
| 	"io" | ||||
| 	"strings" | ||||
| 	"net" | ||||
| 	"testing" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| func expectedPort(t *testing.T, expected string, lsn Listener) { | ||||
| 	parts := strings.Split(lsn.Addr(), ":") | ||||
| 	port := parts[len(parts)-1] | ||||
| 	_, port, err := net.SplitHostPort(lsn.Addr()) | ||||
| 	if err != nil { | ||||
| 		t.Errorf("Expected address to be `%s`, got error: %v", expected, err) | ||||
| 	} | ||||
|  | ||||
| 	if port != expected { | ||||
| 		lsn.Close() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user