code: func handleDirectiveInMergeMap(directive interface{}, patch map[string]interface{}) (map[string]interface{}, error) {
  	if directive == replaceDirective {
  		// If the patch contains "$patch: replace", don't merge it, just use the
  		// patch directly. Later on, we can add a single level replace that only
  		// affects the map that the $patch is in.
  		delete(patch, directiveMarker)
  		return patch, nil
  	}
  
  	if directive == deleteDirective {
  		// If the patch contains "$patch: delete", don't merge it, just return
  		//  an empty map.
  		return map[string]interface{}{}, nil
  	}
  
  	return nil, mergepatch.ErrBadPatchType(directive, patch)
  }
docs: // handleDirectiveInMergeMap handles the patch directive when merging 2 maps.