code: func Free(n int) (ports []int, err error) {
  	mu.Lock()
  	defer mu.Unlock()
  
  	if n > blockSize-1 {
  		return nil, fmt.Errorf("freeport: block size too small")
  	}
  
  	// Reserve a port block
  	once.Do(initialize)
  
  	for len(ports) < n {
  		port++
  
  		// roll-over the port
  		if port < firstPort+1 || port >= firstPort+blockSize {
  			port = firstPort + 1
  		}
  
  		// if the port is in use then skip it
  		ln, err := net.ListenTCP("tcp", tcpAddr("127.0.0.1", port))
  		if err != nil {
  			// log.Println("[DEBUG] freeport: port already in use: ", port)
  			continue
  		}
  		ln.Close()
  
  		ports = append(ports, port)
  	}
  	// log.Println("[DEBUG] freeport: free ports:", ports)
  	return ports, nil
  }
docs: // Free returns a list of free ports from the allocated port block. It is safe
  // to call this method concurrently. Ports have been tested to be available on
  // 127.0.0.1 TCP but there is no guarantee that they will remain free in the
  // future.