Documentation ¶
Index ¶
- func Filter[TVal any, TKey comparable](fn func(v TVal) (bool, TVal), values map[TKey]TVal) (ret []TVal)
- func GetKeys[T1 comparable, T2 ...](sources map[T1]T2) []T1
- func GetValue(obj map[string]any, key string, def any) any
- func GetValues[K comparable, V any | ~struct{}](target map[K]V) []V
- func SetValue(obj map[string]any, key string, val, def any)
- func Zip[TKey ..., TVal ...](keys []TKey, values []TVal) (zip map[TKey]TVal, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
func Filter[TVal any, TKey comparable](fn func(v TVal) (bool, TVal), values map[TKey]TVal) (ret []TVal)
Filter 过滤数组
func GetKeys ¶
func GetKeys[T1 comparable, T2 any | ~struct{} | string | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](sources map[T1]T2) []T1
GetKeys 获取一个字典中所有的key
func GetValues ¶ added in v1.2.0
func GetValues[K comparable, V any | ~struct{}](target map[K]V) []V
GetValues 获取一个字典中所有的value
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.