()
| 10 | ) |
| 11 | |
| 12 | func ExampleFromSeq() { |
| 13 | // Start with an iterator that yields numbers from 1 to 10 |
| 14 | numbersSeq := slices.Values([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) |
| 15 | |
| 16 | // Convert the iterator into a stream |
| 17 | numbers := rill.FromSeq(numbersSeq, nil) |
| 18 | |
| 19 | // Transform each number |
| 20 | // Concurrency = 3 |
| 21 | squares := rill.Map(numbers, 3, func(x int) (int, error) { |
| 22 | return square(x), nil |
| 23 | }) |
| 24 | |
| 25 | printStream(squares) |
| 26 | } |
| 27 | |
| 28 | func ExampleFromSeq2() { |
| 29 | // Create an iter.Seq2 iterator that yields numbers from 1 to 10 |
nothing calls this directly
no test coverage detected