parallel

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 1 Imported by: 46

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEach

func ForEach[T any](collection []T, iteratee func(T, int))

ForEach iterates over elements of collection and invokes iteratee for each element. `iteratee` is call in parallel.

func GroupBy added in v1.4.0

func GroupBy[T any, U comparable](collection []T, iteratee func(T) U) map[U][]T

GroupBy returns an object composed of keys generated from the results of running each element of collection through iteratee. `iteratee` is call in parallel.

func Map

func Map[T any, R any](collection []T, iteratee func(T, int) R) []R

Map manipulates a slice and transforms it to a slice of another type. `iteratee` is call in parallel. Result keep the same order.

func PartitionBy added in v1.4.0

func PartitionBy[T any, K comparable](collection []T, iteratee func(x T) K) [][]T

PartitionBy returns an array of elements split into groups. The order of grouped values is determined by the order they occur in collection. The grouping is generated from the results of running each element of collection through iteratee. `iteratee` is call in parallel.

func Times added in v1.5.0

func Times[T any](count int, iteratee func(int) T) []T

Times invokes the iteratee n times, returning an array of the results of each invocation. The iteratee is invoked with index as argument. `iteratee` is call in parallel.

Types

This section is empty.

Jump to

Keyboard shortcuts

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