From dc291e40278cdab5a5f98ac06aaa8e0fc28f0e92 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Sat, 26 Mar 2016 19:30:04 -0700 Subject: [PATCH] Use empty string for addr in ServerDetails.String() --- consul/server_details/server_details.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/consul/server_details/server_details.go b/consul/server_details/server_details.go index 05356893f1..0040c96402 100644 --- a/consul/server_details/server_details.go +++ b/consul/server_details/server_details.go @@ -48,7 +48,12 @@ func (s *ServerDetails) Key() *Key { // String returns a string representation of ServerDetails func (s *ServerDetails) String() string { - return fmt.Sprintf("%s (Addr: %s) (DC: %s)", s.Name, s.Addr, s.Datacenter) + var serverAddr string + if s.Addr != nil { + serverAddr = s.Addr.String() + s.Addr.Network() + } + + return fmt.Sprintf("%s (Addr: %s) (DC: %s)", s.Name, serverAddr, s.Datacenter) } // IsConsulServer returns true if a serf member is a consul server. Returns a