(s string)
| 16 | } |
| 17 | |
| 18 | func mustParseIPv4Net(s string) *net.IPNet { |
| 19 | _, n, err := net.ParseCIDR(s) |
| 20 | if err != nil { |
| 21 | panic(err) |
| 22 | } |
| 23 | if n.IP.To4() == nil { |
| 24 | panic(xerrors.New("must specify an IPv4 network")) |
| 25 | } |
| 26 | return n |
| 27 | } |
| 28 | |
| 29 | // Adapted from https://gist.github.com/udhos/b468fbfd376aa0b655b6b0c539a88c03#file-nextip-go-L31 |
| 30 | func mustNextIPv4(ip net.IP, inc int) net.IP { |