Browse code

Use net.JoinHostPort to handle address format.

Signed-off-by: Dong Chen <dongluo.chen@docker.com>

Dong Chen authored on 2016/03/02 10:27:30
Showing 1 changed files
... ...
@@ -89,7 +89,7 @@ func ParseAdvertise(advertise string) (string, error) {
89 89
 		return "", fmt.Errorf("couldnt find a valid ip-address in interface %s", advertise)
90 90
 	}
91 91
 
92
-	addr = fmt.Sprintf("%s:%s", addr, port)
92
+	addr = net.JoinHostPort(addr, port)
93 93
 	return addr, nil
94 94
 }
95 95