func (p *Pinger) AddIP(ipaddr string) error {
	addr := net.ParseIP(ipaddr)
	if addr == nil {
		return fmt.Errorf("%s is not a valid textual representation of an IP address", ipaddr)
	}
	p.mu.Lock()
	p.addrs[addr.String()] = &net.IPAddr{IP: addr}
	if isIPv4(addr) {
		p.hasIPv4 = true
	} else if isIPv6(addr) {
		p.hasIPv6 = true
	}
	p.mu.Unlock()
	return nil
}
func (p *Pinger) AddIP(ipaddr string) error {
	addr := net.ParseIP(ipaddr)
	if addr == nil {
		return fmt.Errorf("%s is not a valid textual representation of an IP address", ipaddr)
	}
	p.mu.Lock()
	p.addrs[addr.String()] = &net.IPAddr{IP: addr}
	if isIPv4(addr) {
		p.hasIPv4 = true
	} else if isIPv6(addr) {
		p.hasIPv6 = true
	}
	p.mu.Unlock()
	return nil
}
func ( p * Pinger ) AddIP ( ipaddr string ) error { addr := net . ParseIP ( ipaddr ) if addr == nil { return fmt . Errorf ( " " , ipaddr ) } p . mu . Lock ( ) p . addrs [ addr . String ( ) ] = & net . IPAddr { IP : addr } if isIPv4 ( addr ) { p . hasIPv4 = true } else if isIPv6 ( addr ) { p . hasIPv6 = true } p . mu . Unlock ( ) return nil }
// AddIP adds an IP address to Pinger. ipaddr arg should be a string like
// "192.0.2.1".
AddIP adds an IP address to Pinger . ipaddr arg should be a string like 192 . 0 . 2 . 1 .