utils: fix the SliceIntersect

This commit is contained in:
astaxie 2014-08-22 16:50:07 +08:00
parent 01e4084587
commit 77294a5881
1 changed files with 2 additions and 2 deletions

View File

@ -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)
}
}