February 2018
Intermediate to advanced
340 pages
9h 43m
English
The net package contains the Interfaces function, which lists the network interfaces as a slice of the Interface struct. The Interface struct has the Addrs method, which lists the available network addresses. This way, you can list the addresses by their interfaces.
Another option is to use the InterfaceAddrs function of the net package, which provides the slice of structs that implement the Addr interface. This provides you with methods to obtain the information you want.
Read now
Unlock full access