code: func mergeSlice(original, patch []interface{}, schema LookupPatchMeta, mergeKey string, mergeOptions MergeOptions, isDeleteList bool) ([]interface{}, error) {
  	if len(original) == 0 && len(patch) == 0 {
  		return original, nil
  	}
  
  	// All the values must be of the same type, but not a list.
  	t, err := sliceElementType(original, patch)
  	if err != nil {
  		return nil, err
  	}
  
  	var merged []interface{}
  	kind := t.Kind()
  	// If the elements are not maps, merge the slices of scalars.
  	if kind != reflect.Map {
  		if mergeOptions.MergeParallelList && isDeleteList {
  			return deleteFromSlice(original, patch), nil
  		}
  		// Maybe in the future add a "concat" mode that doesn't
  		// deduplicate.
  		both := append(original, patch...)
  		merged = deduplicateScalars(both)
  
  	} else {
  		if mergeKey == "" {
  			return nil, fmt.Errorf("cannot merge lists without merge key for %s", schema.Name())
  		}
  
  		original, patch, err = mergeSliceWithSpecialElements(original, patch, mergeKey)
  		if err != nil {
  			return nil, err
  		}
  
  		merged, err = mergeSliceWithoutSpecialElements(original, patch, mergeKey, schema, mergeOptions)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	// enforce the order
  	var patchItems, serverOnlyItems []interface{}
  	if len(mergeKey) == 0 {
  		patchItems, serverOnlyItems = partitionPrimitivesByPresentInList(merged, patch)
  	} else {
  		patchItems, serverOnlyItems, err = partitionMapsByPresentInList(merged, patch, mergeKey)
  		if err != nil {
  			return nil, err
  		}
  	}
  	return normalizeElementOrder(patchItems, serverOnlyItems, patch, original, mergeKey, kind)
  }
docs: // Merge two slices together. Note: This may modify both the original slice and
  // the patch because getting a deep copy of a slice in golang is highly
  // non-trivial.