code: func GetColumnsForVersion(crd *CustomResourceDefinition, version string) ([]CustomResourceColumnDefinition, error) {
  	if !HasPerVersionColumns(crd.Spec.Versions) {
  		return serveDefaultColumnsIfEmpty(crd.Spec.AdditionalPrinterColumns), nil
  	}
  	if len(crd.Spec.AdditionalPrinterColumns) > 0 {
  		return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version additionalPrinterColumns must be mutual exclusive", crd.Name, version)
  	}
  	for _, v := range crd.Spec.Versions {
  		if version == v.Name {
  			return serveDefaultColumnsIfEmpty(v.AdditionalPrinterColumns), nil
  		}
  	}
  	return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name)
  }
docs: // GetColumnsForVersion returns the columns for given version or nil.
  // NOTE: the newly logically-defaulted columns is not pointing to the original CRD object.
  // One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through
  // the original CRD object instead.