lucarin91 / go-iterator

A working progress attempt of an iterator library for go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Iterator library

A working progress attempt of an iterator library for go. The objective of the library is also to support a set of functions for working with iterators, e.g., map, and flatten.

Iterator interface

The iterator is composed of two methods Next that advance the iterator and Get for getting the element pointed by the iterator. Here is a usage example:

it := ToIter([]int{1, 2, 3, 4})
for it.Next() {
    fmt.Println(it.Get())
}

About

A working progress attempt of an iterator library for go.


Languages

Language:Go 100.0%