func IsUniqueSlice()

in util/string.go [42:67]


func IsUniqueSlice(list interface{}) bool {
	switch items := list.(type) {
	case []string:
		set := make(map[string]struct{})
		for _, item := range items {
			_, ok := set[item]
			if ok {
				return false
			}
			set[item] = struct{}{}
		}
		return true
	case []int:
		set := make(map[int]struct{})
		for _, item := range items {
			_, ok := set[item]
			if ok {
				return false
			}
			set[item] = struct{}{}
		}
		return true
	}

	panic("only support string and int")
}