()
| 10 | ) |
| 11 | |
| 12 | func ExampleIterator() { |
| 13 | input := []int{1, 2, 3, 4} |
| 14 | iterator := Iterator[int]{ |
| 15 | MaxGoroutines: len(input) / 2, |
| 16 | } |
| 17 | |
| 18 | iterator.ForEach(input, func(v *int) { |
| 19 | if *v%2 != 0 { |
| 20 | *v = -1 |
| 21 | } |
| 22 | }) |
| 23 | |
| 24 | fmt.Println(input) |
| 25 | // Output: |
| 26 | // [-1 2 -1 4] |
| 27 | } |
| 28 | |
| 29 | func TestIterator(t *testing.T) { |
| 30 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…