1
0
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:
Tatsushi Demachi
2014-04-21 10:15:18 +09:00
parent 85b47b7a02
commit f81b4cf5d3
3 changed files with 86 additions and 37 deletions

View File

@@ -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)