()
| 654 | } |
| 655 | |
| 656 | func ExampleMap() { |
| 657 | // Convert a slice of numbers into a stream |
| 658 | numbers := rill.FromSlice([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, nil) |
| 659 | |
| 660 | // Transform each number |
| 661 | // Concurrency = 3 |
| 662 | squares := rill.Map(numbers, 3, func(x int) (int, error) { |
| 663 | return square(x), nil |
| 664 | }) |
| 665 | |
| 666 | printStream(squares) |
| 667 | } |
| 668 | |
| 669 | // The same example as for the [Map], but using ordered versions of functions. |
| 670 | func ExampleOrderedMap() { |
nothing calls this directly
no test coverage detected