From 973c88fd31b629652aa5a18966fc7cd6bae0adf2 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Tue, 9 Apr 2019 10:56:15 +0300 Subject: [PATCH] misc: small fix or general refactoring i did not bother commenting --- modules/net_recon/net_show.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/net_recon/net_show.go b/modules/net_recon/net_show.go index 630f76cf..01c604a2 100644 --- a/modules/net_recon/net_show.go +++ b/modules/net_recon/net_show.go @@ -98,7 +98,14 @@ func (mod *Discovery) getRow(e *network.Endpoint, withMeta bool) [][]string { metas := []string{} e.Meta.Each(func(name string, value interface{}) { - metas = append(metas, fmt.Sprintf("%s:%s", tui.Green(name), tui.Yellow(value.(string)))) + s := "" + if sv, ok := value.(string); ok { + s = sv + } else { + s = fmt.Sprintf("%+v", value) + } + + metas = append(metas, fmt.Sprintf("%s:%s", tui.Green(name), tui.Yellow(s))) }) sort.Strings(metas)