From 33f5b3d9e2214d9ef14eb96bf7ffa78683c581be Mon Sep 17 00:00:00 2001 From: Dong Chen Date: Tue, 1 Mar 2016 17:27:30 -0800 Subject: [PATCH] Use net.JoinHostPort to handle address format. Signed-off-by: Dong Chen --- discovery/backends.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery/backends.go b/discovery/backends.go index f150115..65364c9 100644 --- a/discovery/backends.go +++ b/discovery/backends.go @@ -89,7 +89,7 @@ func ParseAdvertise(advertise string) (string, error) { return "", fmt.Errorf("couldnt find a valid ip-address in interface %s", advertise) } - addr = fmt.Sprintf("%s:%s", addr, port) + addr = net.JoinHostPort(addr, port) return addr, nil }