mirror of
https://github.com/Estom/notes.git
synced 2026-04-04 19:38:33 +08:00
go知识重新整理
This commit is contained in:
16
Go/DesignPattern/Iterator/iterator_test.go
Normal file
16
Go/DesignPattern/Iterator/iterator_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @Author:zhoutao
|
||||
* @Date:2020/12/12 下午12:04
|
||||
* @Desc:
|
||||
*/
|
||||
|
||||
package iterator
|
||||
|
||||
//以相同的方式迭代不同类型的集合
|
||||
|
||||
func ExampleIterator() {
|
||||
var aggregate Aggregate
|
||||
aggregate = NewNumbers(1, 10)
|
||||
|
||||
IteratorPrint(aggregate.Iterator())
|
||||
}
|
||||
Reference in New Issue
Block a user