MCPcopy Create free account
hub / github.com/sourcegraph/conc / Map

Function Map

iter/map.go:20–22  ·  view source on GitHub ↗

Map applies f to each element of input, returning the mapped result. Map always uses at most runtime.GOMAXPROCS goroutines. For a configurable goroutine limit, use a custom Mapper.

(input []T, f func(*T) R)

Source from the content-addressed store, hash-verified

18// Map always uses at most runtime.GOMAXPROCS goroutines. For a configurable
19// goroutine limit, use a custom Mapper.
20func Map[T, R any](input []T, f func(*T) R) []R {
21 return Mapper[T, R]{}.Map(input, f)
22}
23
24// Map applies f to each element of input, returning the mapped result.
25//

Callers 2

TestMapFunction · 0.85
TestMapErrFunction · 0.85

Calls 1

MapMethod · 0.80

Tested by 2

TestMapFunction · 0.68
TestMapErrFunction · 0.68