fix zero result print

This commit is contained in:
mazhuang
2021-11-12 11:58:21 +08:00
parent fbaa312622
commit 80eadc8df2
3 changed files with 15 additions and 10 deletions

View File

@@ -59,6 +59,14 @@ func NewPing() *Ping {
}
func (p *Ping) Run() utils.PingDelaySet {
if len(p.ips) == 0 {
return p.csv
}
ipVersion := "IPv4"
if IPv6 { // IPv6 模式判断
ipVersion = "IPv6"
}
fmt.Printf("开始延迟测速模式TCP %s端口%d ,平均延迟上限:%v平均延迟下限%v)\n", ipVersion, TCPPort, utils.InputMaxDelay, utils.InputMinDelay)
for _, ip := range p.ips {
p.wg.Add(1)
p.control <- false