maps

package
v0.0.0-...-d80f745 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All[M ~map[K]V, K comparable, V any](m M) ([]K, []V)

func BatchAsyncExec

func BatchAsyncExec[M ~map[K]V, K comparable, V any](wg *sync.WaitGroup, m M, batchsize int, fn func(target M) error) error

wg will wait inside the function

func BatchExec

func BatchExec[M ~map[K]V, K comparable, V any](m M, batchsize int, fn func(target M) error) error

遍历map并且分批执行指定函数 每次返回batchsize个元素

func Func

func Func[M ~map[K]V, K comparable, V any](m M, f func(k K, v V))

func Keys

func Keys[M ~map[K]V, K comparable, V any](m M) []K

获取map中的所有key 注意map的遍历是无序的

func Values

func Values[M ~map[K]V, K comparable, V any](m M) []V

获取map中所有value 注意map的遍历是无序的

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL