func DeriveAddressType(value string) AddressType {
	ip := net.ParseIP(value)
	switch {
	case ip == nil:
		// TODO(gz): Check value is a valid hostname
		return HostName
	case ip.To4() != nil:
		return IPv4Address
	case ip.To16() != nil:
		return IPv6Address
	default:
		panic("Unknown form of IP address")
	}
}
// DeriveAddressType attempts to detect the type of address given.
DeriveAddressType attempts to detect the type of address given.
// DeriveAddressType attempts to detect the type of address given .
func DeriveAddressType(value string) AddressType {
	ip := net.ParseIP(value)
	switch {
	case ip == nil:
		return HostName
	case ip.To4() != nil:
		return IPv4Address
	case ip.To16() != nil:
		return IPv6Address
	default:
		panic("Unknown form of IP address")
	}
}
func DeriveAddressType ( value string ) AddressType { ip := net . ParseIP ( value ) switch { case ip == nil : return HostName case ip . To4 ( ) != nil : return IPv4Address case ip . To16 ( ) != nil : return IPv6Address default : panic ( " " ) } }
DeriveAddressType attempts to detect the type of address given.
DeriveAddressType attempts to detect the type of address given .
// TODO(gz): Check value is a valid hostname