Join GitHub today
What version of Go are you using (
Addr is more general than local network interfaces as indicated by the comment above it:
and net.Interface.Addrs() is more general than IP .
net.Interface.Addrs() does return Addr. In this case the type of Addr the system returns is IPNet. I would have also found this to be surprising (that I need to call ParseCIDR on addr.String() to get the IP portion); however, if a local interface has an IP address IPNet is more complete as the mask is important to making decisions about broadcasting and routing.