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 890d4a91b7
commit 2e26098614

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