Documentation ¶
Overview ¶
用于slice 去重 及 检查元素是否存在于 slice 中 去重,支持 booleans, numbers, strings, pointers, channels, arrays of comparable types
t := Unique(s []T)
元素检查,支持 booleans, numbers, strings, pointers, channels, arrays of comparable types
in:= IsExists(s []T) ok := in(a)
Index ¶
- func AtosSlice(a []any) []string
- func Difference[T comparable](a, b []T) ([]T, []T)
- func GetStructKeys(s any, tag string) ([]string, error)
- func Intersection[T comparable](a, b []T) []T
- func IsExists[T comparable](s []T) func(v T) bool
- func StructToMap(object interface{}, tagName string) (map[string]interface{}, error)
- func Union[T comparable](a, b []T) []T
- func Unique[T comparable](s []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExists ¶
func IsExists[T comparable](s []T) func(v T) bool
func StructToMap ¶
结构体转 map[string]interface{}
func Unique ¶
func Unique[T comparable](s []T) []T
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.