mirror of
https://github.com/taigrr/go-fastping
synced 2025-01-18 05:03:15 -08:00
Stop to use panic
This commit is contained in:
@@ -40,7 +40,7 @@ func main() {
|
||||
})
|
||||
|
||||
p.MaxRTT = time.Second
|
||||
quit := p.RunLoop()
|
||||
quit, errch := p.RunLoop()
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
@@ -65,6 +65,9 @@ loop:
|
||||
}
|
||||
results[host] = nil
|
||||
}
|
||||
case err := <-errch:
|
||||
fmt.Println("Ping failed: %v", err)
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
wait := make(chan bool)
|
||||
|
||||
Reference in New Issue
Block a user