mirror of
https://github.com/tmrts/go-patterns.git
synced 2025-02-23 07:33:20 +03:00
6 lines
354 B
Markdown
6 lines
354 B
Markdown
|
# Generator Pattern
|
||
|
|
||
|
[Generator](https://en.wikipedia.org/wiki/Generator_(computer_programming)) is a special routine that can be used to control the iteratoin behavior of a loop.
|
||
|
|
||
|
# Implementation and Example
|
||
|
With Go language, we can Implemente generator in two ways: channel and closure. Fibnacci example can be found in [generators.go](generators.go).
|