code: func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err error) {
  	// Get the groupVersions exposed at /api
  	v := &metav1.APIVersions{}
  	err = d.restClient.Get().AbsPath(d.LegacyPrefix).Do().Into(v)
  	apiGroup := metav1.APIGroup{}
  	if err == nil && len(v.Versions) != 0 {
  		apiGroup = apiVersionsToAPIGroup(v)
  	}
  	if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
  		return nil, err
  	}
  
  	// Get the groupVersions exposed at /apis
  	apiGroupList = &metav1.APIGroupList{}
  	err = d.restClient.Get().AbsPath("/apis").Do().Into(apiGroupList)
  	if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
  		return nil, err
  	}
  	// to be compatible with a v1.0 server, if it's a 403 or 404, ignore and return whatever we got from /api
  	if err != nil && (errors.IsNotFound(err) || errors.IsForbidden(err)) {
  		apiGroupList = &metav1.APIGroupList{}
  	}
  
  	// prepend the group retrieved from /api to the list if not empty
  	if len(v.Versions) != 0 {
  		apiGroupList.Groups = append([]metav1.APIGroup{apiGroup}, apiGroupList.Groups...)
  	}
  	return apiGroupList, nil
  }
docs: // ServerGroups returns the supported groups, with information like supported versions and the
  // preferred version.