Given a network interface (e.g. "eth0"), I'm trying to determine it's IPv4 address.
I can test an IP to see if it's IPv4 with net.IP.DefaultMask() but I'm unable to do this the results of net.Interfaces() because that returns an []Interface struct (from which I can extract an []Addr) and what I need is a net.IP:
I think doing regex on the interface address would be too ugly.
How can I convert a type Addr to a type IP?
Thanks.