go 切片数组去重
func RemoveDuplicateElement(stringList []string) []string { result := make([]string, 0, len(stringList)) temp := map[string]struct{}{} for _, item := range stringList { if _, ok := temp[item]; !ok { temp[item] = struct{}{} result = append(result, item) } } return result }