code: func DefaultServerURL(host, apiPath string, groupVersion schema.GroupVersion, defaultTLS bool) (*url.URL, string, error) {
  	if host == "" {
  		return nil, "", fmt.Errorf("host must be a URL or a host:port pair")
  	}
  	base := host
  	hostURL, err := url.Parse(base)
  	if err != nil || hostURL.Scheme == "" || hostURL.Host == "" {
  		scheme := "http://"
  		if defaultTLS {
  			scheme = "https://"
  		}
  		hostURL, err = url.Parse(scheme + base)
  		if err != nil {
  			return nil, "", err
  		}
  		if hostURL.Path != "" && hostURL.Path != "/" {
  			return nil, "", fmt.Errorf("host must be a URL or a host:port pair: %q", base)
  		}
  	}
  
  	// hostURL.Path is optional; a non-empty Path is treated as a prefix that is to be applied to
  	// all URIs used to access the host. this is useful when there's a proxy in front of the
  	// apiserver that has relocated the apiserver endpoints, forwarding all requests from, for
  	// example, /a/b/c to the apiserver. in this case the Path should be /a/b/c.
  	//
  	// if running without a frontend proxy (that changes the location of the apiserver), then
  	// hostURL.Path should be blank.
  	//
  	// versionedAPIPath, a path relative to baseURL.Path, points to a versioned API base
  	versionedAPIPath := DefaultVersionedAPIPath(apiPath, groupVersion)
  
  	return hostURL, versionedAPIPath, nil
  }
docs: // DefaultServerURL converts a host, host:port, or URL string to the default base server API path
  // to use with a Client at a given API version following the standard conventions for a
  // Kubernetes API.