Documentation ¶
Index ¶
- func Chunk[T any](array []T, chunkSize int) [][]T
- func ChunkMap[K comparable, V any](array map[K]V, chunkSize int) []map[K]V
- func Column[T any, N comparable, K comparable](array map[N]map[K]T, columnKey K) []T
- func Diff[T comparable](a []T, b ...[]T) []T
- func In[T comparable](array []T, find T) bool
- func Intersect[T comparable](a []T, b ...[]T) []T
- func Keys[V comparable](array []V, find V) []int
- func KeysFind[K comparable, V comparable](array map[K]V, find V) []K
- func KeysMap[K comparable, V any](array map[K]V) []K
- func NotIn[T comparable](array []T, find T) bool
- func ToLower(array []string) []string
- func ToUpper(array []string) []string
- func Values[K comparable, V any](array map[K]V) []V
- type CombineNum
- type SliceWithMutex
- type Sort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkMap ¶
func ChunkMap[K comparable, V any](array map[K]V, chunkSize int) []map[K]V
ChunkMap Map分组
func Column ¶
func Column[T any, N comparable, K comparable](array map[N]map[K]T, columnKey K) []T
Column 获取Map指定column
func Intersect ¶ added in v1.0.14
func Intersect[T comparable](a []T, b ...[]T) []T
Intersect 获取切片a、b的交集
func KeysFind ¶
func KeysFind[K comparable, V comparable](array map[K]V, find V) []K
KeysFind 获取Map指定值的key
func KeysMap ¶ added in v1.0.13
func KeysMap[K comparable, V any](array map[K]V) []K
KeysMap 获取Map的key
Types ¶
type CombineNum ¶
func (*CombineNum) Parse ¶
func (c *CombineNum) Parse(text string) []string
type SliceWithMutex ¶ added in v1.0.1
type SliceWithMutex[T any] struct { // contains filtered or unexported fields }
func (*SliceWithMutex[T]) Add ¶ added in v1.0.1
func (s *SliceWithMutex[T]) Add(value T)
func (*SliceWithMutex[T]) All ¶ added in v1.0.1
func (s *SliceWithMutex[T]) All() []T
func (*SliceWithMutex[T]) Get ¶ added in v1.0.1
func (s *SliceWithMutex[T]) Get(index int) T
func (*SliceWithMutex[T]) Len ¶ added in v1.0.1
func (s *SliceWithMutex[T]) Len() int
func (*SliceWithMutex[T]) Pop ¶ added in v1.0.1
func (s *SliceWithMutex[T]) Pop() []T
Click to show internal directories.
Click to hide internal directories.