code: func newPortAllocator(r net.PortRange) PortAllocator {
  	if r.Base == 0 {
  		return &randomAllocator{}
  	}
  	return newPortRangeAllocator(r, true)
  }
docs: // newPortAllocator builds PortAllocator for a given PortRange. If the PortRange is empty
  // then a random port allocator is returned; otherwise, a new range-based allocator
  // is returned.