Commit 77294a58 authored by astaxie's avatar astaxie

utils: fix the SliceIntersect

parent 01e40845
......@@ -106,10 +106,10 @@ func SliceDiff(slice1, slice2 []interface{}) (diffslice []interface{}) {
return
}
// SliceIntersect returns diff slice of slice1 - slice2.
// SliceIntersect returns slice that are present in all the slice1 and slice2.
func SliceIntersect(slice1, slice2 []interface{}) (diffslice []interface{}) {
for _, v := range slice1 {
if !InSliceIface(v, slice2) {
if InSliceIface(v, slice2) {
diffslice = append(diffslice, v)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment