code: func EndpointURL(ctx context.Context, c *vim25.Client, path string, filter *types.LookupServiceRegistrationFilter) string {
  	if lu, err := NewClient(ctx, c); err == nil {
  		info, _ := lu.List(ctx, filter)
  		if len(info) != 0 && len(info[0].ServiceEndpoints) != 0 {
  			endpoint := &info[0].ServiceEndpoints[0]
  			path = endpoint.Url
  
  			if u, err := url.Parse(path); err == nil {
  				if c.Thumbprint(u.Host) == "" {
  					c.SetThumbprint(u.Host, endpointThumbprint(endpoint))
  				}
  			}
  		}
  	}
  	return path
  }
docs: // EndpointURL uses the Lookup Service to find the endpoint URL and thumbprint for the given filter.
  // If the endpoint is found, its TLS certificate is also added to the vim25.Client's trusted host thumbprints.
  // If the Lookup Service is not available, the given path is returned as the default.