code: func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error) {
  	accessor, err := meta.Accessor(obj)
  	if err != nil {
  		return "", nil
  	}
  
  	if path, subscript, ok := SplitMaybeSubscriptedPath(fieldPath); ok {
  		switch path {
  		case "metadata.annotations":
  			if errs := validation.IsQualifiedName(strings.ToLower(subscript)); len(errs) != 0 {
  				return "", fmt.Errorf("invalid key subscript in %s: %s", fieldPath, strings.Join(errs, ";"))
  			}
  			return accessor.GetAnnotations()[subscript], nil
  		case "metadata.labels":
  			if errs := validation.IsQualifiedName(subscript); len(errs) != 0 {
  				return "", fmt.Errorf("invalid key subscript in %s: %s", fieldPath, strings.Join(errs, ";"))
  			}
  			return accessor.GetLabels()[subscript], nil
  		default:
  			return "", fmt.Errorf("fieldPath %q does not support subscript", fieldPath)
  		}
  	}
  
  	switch fieldPath {
  	case "metadata.annotations":
  		return FormatMap(accessor.GetAnnotations()), nil
  	case "metadata.labels":
  		return FormatMap(accessor.GetLabels()), nil
  	case "metadata.name":
  		return accessor.GetName(), nil
  	case "metadata.namespace":
  		return accessor.GetNamespace(), nil
  	case "metadata.uid":
  		return string(accessor.GetUID()), nil
  	}
  
  	return "", fmt.Errorf("unsupported fieldPath: %v", fieldPath)
  }
docs: // ExtractFieldPathAsString extracts the field from the given object
  // and returns it as a string.  The object must be a pointer to an
  // API type.