func resolveAddr(t string, ver int) (net.IP, error) {
	if ip := net.ParseIP(t); ip != nil {
		if ipVersion(ip) == ver {
			return ip, nil
		}
		return nil, fmt.Errorf("IP (%s) is not an IPv%d address", ip, ver)
	}
	ips, err := net.LookupIP(t)
	if err != nil {
		return nil, err
	}
	for _, ip := range ips {
		if ver == ipVersion(ip) {
			return ip, nil
		}
	}
	return nil, fmt.Errorf("no good IPs found for the ip version (%d). IPs found: %q", ver, ips)
}
// resolveAddr resolves a host name into an IP address.
resolveAddr resolves a host name into an IP address.
// resolveAddr resolves a host name into an IP address .
func resolveAddr(t string, ver int) (net.IP, error) {
	if ip := net.ParseIP(t); ip != nil {
		if ipVersion(ip) == ver {
			return ip, nil
		}
		return nil, fmt.Errorf("IP (%s) is not an IPv%d address", ip, ver)
	}
	ips, err := net.LookupIP(t)
	if err != nil {
		return nil, err
	}
	for _, ip := range ips {
		if ver == ipVersion(ip) {
			return ip, nil
		}
	}
	return nil, fmt.Errorf("no good IPs found for the ip version (%d). IPs found: %q", ver, ips)
}
func resolveAddr ( t string , ver int ) ( net . IP , error ) { if ip := net . ParseIP ( t ) ; ip != nil { if ipVersion ( ip ) == ver { return ip , nil } return nil , fmt . Errorf ( " " , ip , ver ) } ips , err := net . LookupIP ( t ) if err != nil { return nil , err } for _ , ip := range ips { if ver == ipVersion ( ip ) { return ip , nil } } return nil , fmt . Errorf ( " " , ver , ips ) }
resolveAddr resolves a host name into an IP address.
resolveAddr resolves a host name into an IP address .