perf net: Do not show Err: tag if there is no error (#4700)

This commit is contained in:
Anis Eleuch
2023-09-28 15:59:55 -07:00
committed by GitHub
parent 103272612a
commit 1a65176cee
+5 -1
View File
@@ -212,11 +212,15 @@ func (m *speedTestUI) View() string {
})
} else {
for _, nodeResult := range nres.NodeResults {
nodeErr := ""
if nodeResult.Error != "" {
nodeErr = "Err: " + nodeResult.Error
}
data = append(data, []string{
trailerIfGreaterThan(nodeResult.Endpoint, 64),
whiteStyle.Render(humanize.IBytes(uint64(nodeResult.RX))) + "/s",
whiteStyle.Render(humanize.IBytes(uint64(nodeResult.TX))) + "/s",
"Err: " + nodeResult.Error,
nodeErr,
})
}
}