parse.go 259 B

12345678910
  1. package cidr
  2. import "net"
  3. // Parse is a convenience function that returns only the IPNet
  4. // This function ignores errors since it is primarily a test helper, the result could be nil
  5. func Parse(s string) *net.IPNet {
  6. _, c, _ := net.ParseCIDR(s)
  7. return c
  8. }