I am trying to get the IP address and subnet mask by
ifaces, err := net.Interfaces()
for _, iface := range ifaces{
localip, _ = iface.Addrs()
}
However, I am looking forward to get the subnet as something like 255.255.255.0
rather than /24
. How can I get that? If there are no modules that can do this, what is the logic to do this as a program?