func _arrayDiff(array1 []int, othersParams []int) ([]int, error) {
if len(array1) == 0 {
return []int{}, nil
}
if len(array1) > 0 && len(othersParams) == 0 {
return array1, nil
}
var tmp = make(map[string]int, len(array1))
for i, v := range array1 {
// 唯一key
key := fmt.Sprintf("%d-%d",i,v)
tmp[key] = v
}
for _, arg := range othersParams {
for i,v := range tmp{
if v != -1 && v == arg{
tmp[i] = -1
break
}
}
}
var res = make([]int, 0, len(tmp))
for _, v := range tmp {
if v != -1 {
res = append(res, v)
}
}
return res, nil
}