Skip to content

j178/it

Repository files navigation

itertools for Go (1.22+)

Go Version Go Reference CI Go Report Card codecov

Go1.22 will support range over function and introduce the iter std package. (Behind the GOEXPERIMENT=rangefunc gate.)

See more at RangefuncExperiment.

This package provides a set of iterator functions borrowed from Python and Rust.

Some code are copied from Russ Cox's proposals 61898, 61899 and 61900.

Installation

go get github.com/j178/it

Usage

To use this package, you need to install at least Go 1.22(not released yet) and set GOEXPERIMENT=rangefunc.

go install golang.org/dl/gotip@latest
gotip download

GOEXPERIMENT=rangefunc gotip run main.go