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

Function ExampleMapper

iter/map_test.go:11–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func ExampleMapper() {
12 input := []int{1, 2, 3, 4}
13 mapper := Mapper[int, bool]{
14 MaxGoroutines: len(input) / 2,
15 }
16
17 results := mapper.Map(input, func(v *int) bool { return *v%2 == 0 })
18 fmt.Println(results)
19 // Output:
20 // [false true false true]
21}
22
23func TestMap(t *testing.T) {
24 t.Parallel()

Callers

nothing calls this directly

Calls 1

MapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…