code: func extractToDeleteItems(l []interface{}) ([]interface{}, []interface{}, error) {
  	var nonDelete, toDelete []interface{}
  	for _, v := range l {
  		m, ok := v.(map[string]interface{})
  		if !ok {
  			return nil, nil, mergepatch.ErrBadArgType(m, v)
  		}
  
  		directive, foundDirective := m[directiveMarker]
  		if foundDirective && directive == deleteDirective {
  			toDelete = append(toDelete, v)
  		} else {
  			nonDelete = append(nonDelete, v)
  		}
  	}
  	return nonDelete, toDelete, nil
  }
docs: // extractToDeleteItems takes a list and
  // returns 2 lists: one contains items that should be kept and the other contains items to be deleted.