code: func (o AnnotateOptions) updateAnnotations(obj runtime.Object) error {
  	accessor, err := meta.Accessor(obj)
  	if err != nil {
  		return err
  	}
  	if !o.overwrite {
  		if err := validateNoAnnotationOverwrites(accessor, o.newAnnotations); err != nil {
  			return err
  		}
  	}
  
  	annotations := accessor.GetAnnotations()
  	if annotations == nil {
  		annotations = make(map[string]string)
  	}
  
  	for key, value := range o.newAnnotations {
  		annotations[key] = value
  	}
  	for _, annotation := range o.removeAnnotations {
  		delete(annotations, annotation)
  	}
  	accessor.SetAnnotations(annotations)
  
  	if len(o.resourceVersion) != 0 {
  		accessor.SetResourceVersion(o.resourceVersion)
  	}
  	return nil
  }
docs: // updateAnnotations updates annotations of obj