mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-11-11 23:07:51 +03:00
concurrency/generator: implement generator pattern
This commit is contained in:
1 parent
90f5b5b1a5
commit
d05638adac
3 files changed
+50
-1
No files matched your search
@@ -0,0 +1,6 @@
|
||||
# Generator Pattern
|
||||
|
||||
[Generator](https://en.wikipedia.org/wiki/Generator_(computer_programming)) 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. Fibonacci number generation example can be found in [generators.go](generators.go).
|
||||
Reference in new issue
Block a user