code: func lookup(
  	first func(i int) net.IP,
  	full func(i int) Range,
  	n int,
  	ip net.IP,
  ) (
  	r Range, ok bool,
  ) {
  	// Find the index of the first range for which the following range exceeds
  	// it.
  	i := sort.Search(n, func(i int) bool {
  		if i+1 >= n {
  			return true
  		}
  		return bytes.Compare(ip, first(i+1)) < 0
  	})
  	if i == n {
  		return
  	}
  	r = full(i)
  	ok = bytes.Compare(r.First, ip) <= 0 && bytes.Compare(ip, r.Last) <= 0
  	return
  }
docs: // Return a range that contains ip, or nil.