mirror of
https://github.com/taigrr/go-fastping
synced 2025-01-18 05:03:15 -08:00
Fix RunLoop example
This commit is contained in:
parent
4b49bd943e
commit
e5a0822b78
@ -171,13 +171,17 @@ func (p *Pinger) Run() error {
|
|||||||
// wait := make(chan bool)
|
// wait := make(chan bool)
|
||||||
// quit, errch := p.RunLoop()
|
// quit, errch := p.RunLoop()
|
||||||
// ticker := time.NewTicker(time.Millisecond * 250)
|
// ticker := time.NewTicker(time.Millisecond * 250)
|
||||||
|
// loop:
|
||||||
|
// for {
|
||||||
// select {
|
// select {
|
||||||
// case err := <-errch:
|
// case err := <-errch:
|
||||||
// log.Fatalf("Ping failed: %v", err)
|
// log.Fatalf("Ping failed: %v", err)
|
||||||
// case <-ticker.C:
|
// case <-ticker.C:
|
||||||
|
// ticker.Stop()
|
||||||
// quit <- wait
|
// quit <- wait
|
||||||
// case <-wait:
|
// case <-wait:
|
||||||
// break
|
// break loop
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// For more detail, please see "cmd/ping/ping.go".
|
// For more detail, please see "cmd/ping/ping.go".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user