code: func normalizeSliceOrder(toSort, order []interface{}, mergeKey string, kind reflect.Kind) ([]interface{}, error) {
  	var toDelete []interface{}
  	if kind == reflect.Map {
  		// make sure each item in toSort, order has merge key
  		err := validateMergeKeyInLists(mergeKey, toSort, order)
  		if err != nil {
  			return nil, err
  		}
  		toSort, toDelete, err = extractToDeleteItems(toSort)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	sort.SliceStable(toSort, func(i, j int) bool {
  		if ii := index(order, toSort[i], mergeKey, kind); ii >= 0 {
  			if ij := index(order, toSort[j], mergeKey, kind); ij >= 0 {
  				return ii < ij
  			}
  		}
  		return true
  	})
  	toSort = append(toSort, toDelete...)
  	return toSort, nil
  }
docs: // normalizeSliceOrder sort `toSort` list by `order`