合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
~~~ package iterator import ( "fmt" "testing" ) func TestIterator(t *testing.T) { bg := BookGroup{} nb := Book{"a"} bg.add(nb) nbb := Book{"b"} bg.add(nbb) it := bg.createIterator() for b := it.first(); b != nil; b = it.next() { fmt.Println(b) } } ~~~