Use net.JoinHostPort to handle address format.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
parent
332306a8d4
commit
33f5b3d9e2
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue