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 Action(method, surl string, headers map[string]string, data any, ...) (http_code int, res []byte, err error)
- func AtosSlice(a []any) []string
- func Conform(s string) bool
- func Delete(surl string, headers map[string]string, data any, timeout time.Duration) (http_code int, res []byte, err error)
- func Difference[T comparable](a, b []T) ([]T, []T)
- func Get(surl string, headers map[string]string, data map[string]string, ...) (http_code int, res []byte, err error)
- 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 MatchCN(s string) bool
- func Post(surl string, headers map[string]string, data any, timeout time.Duration) (http_code int, res []byte, err error)
- func Put(surl string, headers map[string]string, data any, timeout time.Duration) (http_code int, res []byte, err error)
- 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.