code: func (op *PortAllocationOperation) Allocate(port int) error {
  	if op.dryRun {
  		if op.pa.Has(port) {
  			return ErrAllocated
  		}
  		for _, a := range op.allocated {
  			if port == a {
  				return ErrAllocated
  			}
  		}
  		op.allocated = append(op.allocated, port)
  		return nil
  	}
  
  	err := op.pa.Allocate(port)
  	if err == nil {
  		op.allocated = append(op.allocated, port)
  	}
  	return err
  }
docs: // Allocates a port, and record it for future rollback