services: format ipv6 in nomad service info output

Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
This commit is contained in:
Seth Hoenig 2022-04-22 08:14:51 -05:00
parent 3fcac242c6
commit ae6048eafa
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ func formatAddress(address string, port int) string {
if port == 0 {
return address
}
return fmt.Sprintf("%s:%d", address, port)
return net.JoinHostPort(address, strconv.Itoa(port))
}
// formatOutput produces the verbose output of service registration info for a