code: func PortForwardLocation(
  	getter ResourceGetter,
  	connInfo client.ConnectionInfoGetter,
  	ctx context.Context,
  	name string,
  	opts *api.PodPortForwardOptions,
  ) (*url.URL, http.RoundTripper, error) {
  	pod, err := getPod(getter, ctx, name)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	nodeName := types.NodeName(pod.Spec.NodeName)
  	if len(nodeName) == 0 {
  		// If pod has not been assigned a host, return an empty location
  		return nil, nil, errors.NewBadRequest(fmt.Sprintf("pod %s does not have a host assigned", name))
  	}
  	nodeInfo, err := connInfo.GetConnectionInfo(ctx, nodeName)
  	if err != nil {
  		return nil, nil, err
  	}
  	params := url.Values{}
  	if err := streamParams(params, opts); err != nil {
  		return nil, nil, err
  	}
  	loc := &url.URL{
  		Scheme:   nodeInfo.Scheme,
  		Host:     net.JoinHostPort(nodeInfo.Hostname, nodeInfo.Port),
  		Path:     fmt.Sprintf("/portForward/%s/%s", pod.Namespace, pod.Name),
  		RawQuery: params.Encode(),
  	}
  	return loc, nodeInfo.Transport, nil
  }
docs: // PortForwardLocation returns the port-forward URL for a pod.