Ok, that's sufficient for me. It's only dangerous that if you switch the 
cases (To16() first) it does not work any more.

Am Donnerstag, 16. Juni 2016 17:18:37 UTC+2 schrieb Paul Borman:
>
> Do you mean like To4 and To16 that are defined on net.IP?
>
> switch {
> case ip.To4() != nil:
>     // is an IPv4 address
> case ip.To16() != nil:
>     // is an IPv6 address
> default:
>     // is something else
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to