code: func sortMergeListsByNameArray(s []interface{}, schema LookupPatchMeta, mergeKey string, recurse bool) ([]interface{}, error) {
  	if len(s) == 0 {
  		return s, nil
  	}
  
  	// We don't support lists of lists yet.
  	t, err := sliceElementType(s)
  	if err != nil {
  		return nil, err
  	}
  
  	// If the elements are not maps...
  	if t.Kind() != reflect.Map {
  		// Sort the elements, because they may have been merged out of order.
  		return deduplicateAndSortScalars(s), nil
  	}
  
  	// Elements are maps - if one of the keys of the map is a map or a
  	// list, we may need to recurse into it.
  	newS := []interface{}{}
  	for _, elem := range s {
  		if recurse {
  			typedElem := elem.(map[string]interface{})
  			newElem, err := sortMergeListsByNameMap(typedElem, schema)
  			if err != nil {
  				return nil, err
  			}
  
  			newS = append(newS, newElem)
  		} else {
  			newS = append(newS, elem)
  		}
  	}
  
  	// Sort the maps.
  	newS = sortMapsBasedOnField(newS, mergeKey)
  	return newS, nil
  }
docs: // Function sortMergeListsByNameMap recursively sorts the merge lists by its mergeKey in an array.