func Ping(ip string) (*PingResult, error) {
	pinger := &Pinger{}
	pinger.AddIPs([]string{ip})

	res, err := pinger.Start()
	if err != nil {
		return nil, err
	}

	select {
	case pr := <-res:
		return pr, nil

	case <-time.Tick(100 * time.Millisecond):
		return nil, fmt.Errorf("ping/Ping: timed out waiting for echo reply")
	}
}
// Ping sends ICMP ECHO_REQUEST to a single IP address, wait for the ECHO_REPLY,
// and returns the result.
Ping sends ICMP ECHO_REQUEST to a single IP address, wait for the ECHO_REPLY,
and returns the result.
// Ping sends ICMP ECHO_REQUEST to a single IP address wait for the ECHO_REPLY // and returns the result .
func Ping(ip string) (*PingResult, error) {
	pinger := &Pinger{}
	pinger.AddIPs([]string{ip})
	res, err := pinger.Start()
	if err != nil {
		return nil, err
	}
	select {
	case pr := <-res:
		return pr, nil
	case <-time.Tick(100 * time.Millisecond):
		return nil, fmt.Errorf("ping/Ping: timed out waiting for echo reply")
	}
}
func Ping ( ip string ) ( * PingResult , error ) { pinger := & Pinger { } pinger . AddIPs ( [ ] string { ip } ) res , err := pinger . Start ( ) if err != nil { return nil , err } select { case pr := <- res : return pr , nil case <- time . Tick ( 100 * time . Millisecond ) : return nil , fmt . Errorf ( " " ) } }
Ping sends ICMP ECHO_REQUEST to a single IP address, wait for the ECHO_REPLY,
and returns the result.
Ping sends ICMP ECHO_REQUEST to a single IP address wait for the ECHO_REPLY and returns the result .