misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2019-04-09 10:56:15 +03:00
parent 5dd248cef8
commit 973c88fd31
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -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)