uids 里去除重復(fù)的uid,思路其實(shí)都差不多
func RemoveRepeatUid(uids []int64) []int64 {
tempUids := []int64{}
for _, i := range uids {
if len(tempUids) == 0 {
tempUids = append(tempUids, i)
} else {
for k, v := range tempUids {
if i == v {
break
}
if k == len(tempUids)-1 {
tempUids = append(tempUids, i)
}
}
}
}
return tempUids
}