Go Iterators: A Practical Guide to the iter Package
Originally published on danilchenko.dev.
TL;DR
Go 1.23 shipped the iter package and range-over-func in August 2024, and after 20 months of real use the shape of idiomatic Go iterators is pretty settled. You write a function that takes a yield func(V...
danilchenko.hashnode.dev10 min read