Fun with Go Iterators
(xnacly.me)
Go version 1.23 added iterator support 1 and the iter package 2. We can now loop over constants, containers (maps, slices, arrays, strings) and functions. At first I found the iterator creation clunky, while consuming the iterator seems straightforward.
Go version 1.23 added iterator support 1 and the iter package 2. We can now loop over constants, containers (maps, slices, arrays, strings) and functions. At first I found the iterator creation clunky, while consuming the iterator seems straightforward.