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]
}
更多评论