code: func RandPort() (int, error) {
  	var port int
  	addr, err := net.ResolveTCPAddr("tcp", "localhost:0")
  	if err != nil {
  		return port, err
  	}
  	listener, err := net.ListenTCP("tcp", addr)
  	if err != nil {
  		return port, fmt.Errorf("could not listen to find random port: %v", err)
  	}
  	randAddr := listener.Addr().(*net.TCPAddr)
  	if err := listener.Close(); err != nil {
  		return port, fmt.Errorf("could not close random listener: %v", err)
  	}
  	return randAddr.Port, nil
  }
docs: // RandPort returns a random port to listen on.