code: func (p *portAllocator) ClaimPorts(numPorts int) (uint16, error) {
  	port := p.nextPort
  	if p.endingPort < port+uint16(numPorts-1) {
  		return 0, errors.New("insufficient ports available")
  	}
  
  	p.nextPort = p.nextPort + uint16(numPorts)
  	return uint16(port), nil
  }
docs: // ClaimPorts returns a new uint16 port to be used for testing processes.
  //
  // No guarantees are made that something is not already listening on that port.
  // If running multiple processes, you should initialize the portAllocator with different ranges.
  // If ports are also allocated by another method, the portAllocator should be
  // provided with a range that skips those other ports.
  //
  // numPorts indicates the number of ports that will be claimed. The first claimed
  // port is returned, and the next numPorts-1 ports sequentially after that are yours
  // to use.
  //
  // returns a non-nil error if there are not enough ports in the range compared to
  // the number requested.