Skip to content

Glossary: Software Design Patterns in Go

Iterator

Also written: iterators, iter.Seq

A way to step through a collection one item at a time without showing how it is stored. Every `for range` loop uses one, and since Go 1.23 an `iter.Seq` is a function that calls `yield` once per item.

Where the book teaches it

Related terms

Behavioral pattern