https://github.com/j178/it
Iterator tools for Go 1.22+
https://github.com/j178/it
experimental go iterators
Last synced: 12 months ago
JSON representation
Iterator tools for Go 1.22+
- Host: GitHub
- URL: https://github.com/j178/it
- Owner: j178
- License: mit
- Created: 2023-12-11T06:47:49.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-18T05:58:47.000Z (over 2 years ago)
- Last Synced: 2025-06-12T18:50:33.115Z (12 months ago)
- Topics: experimental, go, iterators
- Language: Go
- Homepage: https://pkg.go.dev/github.com/j178/it
- Size: 62.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# itertools for Go (1.22+)

[](https://pkg.go.dev/github.com/j178/it)
[](https://github.com/j178/it/actions/workflows/ci.yaml)
[](https://goreportcard.com/report/github.com/j178/it)
[](https://codecov.io/gh/j178/it)
Go1.22 will support [`range over function`](https://github.com/golang/go/issues/61405) and introduce the [`iter`](https://github.com/golang/go/issues/61897) std package.
(Behind the `GOEXPERIMENT=rangefunc` gate.)
See more at [RangefuncExperiment](https://github.com/golang/go/wiki/RangefuncExperiment).
This package provides a set of iterator functions borrowed from Python and Rust.
Some code are copied from Russ Cox's proposals [61898](https://github.com/golang/go/issues/61898), [61899](https://github.com/golang/go/issues/61899) and [61900](https://github.com/golang/go/issues/61900).
## Installation
```bash
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`.
```bash
go install golang.org/dl/gotip@latest
gotip download
GOEXPERIMENT=rangefunc gotip run main.go
```