From d7da27a69209e0578c6c02dd3f0924f7ea1b8038 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Wed, 27 May 2015 11:22:12 +0200 Subject: [PATCH] Function has slowly become dead code; remove it --- report/topology.go | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/report/topology.go b/report/topology.go index d4215bef1..f461ab234 100644 --- a/report/topology.go +++ b/report/topology.go @@ -1,7 +1,6 @@ package report import ( - "net" "reflect" "strings" ) @@ -118,7 +117,7 @@ func (t Topology) RenderBy(f MapFunc, grouped bool) map[string]RenderableNode { var maj, min string if dstNodeAddress == TheInternet { dstRenderableID = dstNodeAddress - maj, min = formatLabel(dstNodeAddress) + maj, min = "the Internet", "" } else if grouped { dstRenderableID = localUnknown maj, min = "", "" @@ -190,26 +189,6 @@ func (t Topology) EdgeMetadata(f MapFunc, grouped bool, srcRenderableID, dstRend return metadata } -// formatLabel is an opportunistic helper to format any addressID into -// something we can show on screen. -func formatLabel(s string) (major, minor string) { - if s == TheInternet { - return "the Internet", "" - } - - // Format is either "scope;ip;port", "scope;ip", or some process id. - parts := strings.SplitN(s, ScopeDelim, 3) - if len(parts) < 2 { - return s, "" - } - - if len(parts) == 2 { - return parts[1], "" - } - - return net.JoinHostPort(parts[1], parts[2]), "" -} - // Diff is returned by TopoDiff. It represents the changes between two // RenderableNode maps. type Diff struct {