downnload and upload speeds commented due to inaccruate results

This commit is contained in:
2021-05-03 04:24:03 +04:00
parent 336d88e36c
commit 9df89cb075
4 changed files with 66 additions and 59 deletions

View File

@@ -82,9 +82,9 @@ func PrintIpTable() error {
}
for i := 0; i < len(table.IpAddress); i++ {
fmt.Printf("----------------------\nIP Address: %s\nLatency: %s\nDownload: %f\nUplaod: %f\n-----------" +
"-----------\n",table.IpAddress[i].Ipv4,
table.IpAddress[i].Latency,table.IpAddress[i].Download,table.IpAddress[i].Upload)
fmt.Printf("\nIP Address: %s\nLatency: %s\n-----------" +
"-----------------\n",table.IpAddress[i].Ipv4,
table.IpAddress[i].Latency)
}
return nil
}

View File

@@ -20,15 +20,18 @@ func (ip *IpAddresses)SpeedTest() error{
}
//Upload Speed Test
err = value.UploadSpeed()
if err != nil {
return err
}
//err = value.UploadSpeed()
//if err != nil {
// return err
//}
//
//err = value.DownloadSpeed()
//if err != nil {
// return err
//}
err = value.DownloadSpeed()
if err != nil {
return err
}
//Set value to the list
ip.IpAddress[i] = value
}
@@ -95,7 +98,7 @@ func LocalSpeedTestIpTable() error {
}
// Helper function to remove element from an array of a struct
func remove(s []IpAddress, i int) []IpAddress {
s[len(s)-1], s[i] = s[i], s[len(s)-1]
return s[:len(s)-1]
}
//func remove(s []IpAddress, i int) []IpAddress {
// s[len(s)-1], s[i] = s[i], s[len(s)-1]
// return s[:len(s)-1]
//}