(ip string)
| 66 | } |
| 67 | |
| 68 | func ipToInt(ip string) int { |
| 69 | ips := strings.Split(ip, ".") |
| 70 | ipInt := 0 |
| 71 | var pos uint = 24 |
| 72 | for _, ipItem := range ips { |
| 73 | ipint, _ := strconv.Atoi(ipItem) |
| 74 | ipint = ipint << pos |
| 75 | ipInt = ipInt | ipint |
| 76 | pos -= 8 |
| 77 | } |
| 78 | return ipInt |
| 79 | } |
| 80 | func init() { |
| 81 | var err error |
| 82 | err = initIPAddress() |
no outgoing calls
no test coverage detected