From all the IP addresses of this interface, extract the IPv4 address where we'll bind to
(addrs []net.Addr)
| 215 | // From all the IP addresses of this interface, |
| 216 | // extract the IPv4 address where we'll bind to |
| 217 | func getValidIPv4Addr(addrs []net.Addr) net.IP { |
| 218 | var ip net.IP |
| 219 | for _, addr := range addrs { // amongst all addrs, |
| 220 | ip = addr.(*net.IPNet).IP.To4() // pick the IPv4 addr |
| 221 | if ip != nil && ip.String() != "127.0.0.1" { |
| 222 | break |
| 223 | } |
| 224 | } |
| 225 | return ip |
| 226 | } |
| 227 | |
| 228 | // parses cmd line flag and set appropriate variables |
| 229 | func initFlags() { |
no outgoing calls
no test coverage detected