1
0
mirror of https://github.com/tmrts/go-patterns.git synced 2025-02-22 23:23:28 +03:00
go-patterns/concurrency/generator.md
2016-09-07 00:20:30 +08:00

353 B

Generator Pattern

Generator is a special routine that can be used to control the iteration behavior of a loop.

Implementation and Example

With Go language, we can implement generator in two ways: channel and closure. Fibnacci example can be found in generators.go.