1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Use net.JoinHostPort to handle address format.

Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
Dong Chen 2016-03-01 17:27:30 -08:00
parent f7c9214e29
commit 7554e882df

View file

@ -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
}