Code samples from Go Cookbook.
Chapter: 3 ways to iterate.
Legend:
- inlined.go : iteration and processing commingled
- callback.go : iteration code calls a processing callback for each item
- next.go : iterator is a struct that implements
Next
method to advance to the next item - channel.go : generator sends items over a channel
- channel-cancellable.go : generator sends items over a channel, added ability to stop the generator by the client