code: func ValidateEndpoints(endpoints *api.Endpoints) field.ErrorList {
  	allErrs := ValidateObjectMeta(&endpoints.ObjectMeta, true, ValidateEndpointsName, field.NewPath("metadata"))
  	allErrs = append(allErrs, validateEndpointSubsets(endpoints.Subsets, field.NewPath("subsets"))...)
  	return allErrs
  }
docs: // ValidateEndpoints tests if required fields are set.