func removeDuplicate(slis *[]string) {
found := make(map[string]bool)
j := 0
for i,val := range *slis {
if _,ok := found[val]; !ok {
found[val] = true
(*slis)[j] = (*slis)[i]
j++
}
}
*slis = (*slis)[:j]
}
有疑问加站长微信联系(非本文作者)