Skip to content

Go Iterator Implementation with support for Generics (requires Go v1.18+)

License

Notifications You must be signed in to change notification settings

felix-kaestner/iterator

Repository files navigation

Iterator

Go Iterator Implementation with support for Generics (requires Go v1.18+).

Issues Stars License Stars Issues Twitter

Quickstart

package main

import (
	"fmt"

	"github.com/felix-kaestner/iterator"
)

func main() {
	s := []int{1, 2, 3}
	i := iterator.FromSlice(s)

	for i.HasNext() {
		item, _ := i.Next()
		fmt.Println(fmt.Sprintf("item: %d", *item))
	}
}

Output:

item: 1
item: 2
item: 3

Installation

Install with the go get command:

$ go get -u github.com/felix-kaestner/iterator

Contribute

All contributions in any form are welcome! 🙌🏻
Just use the Issue and Pull Request templates and I'll be happy to review your suggestions. 👍


Released under the MIT License.

About

Go Iterator Implementation with support for Generics (requires Go v1.18+)

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project