2 ms·
It's more between repeatable iterables and one-shot iterables (of which iterators are a subset, as iterators are iterable). For instance a file is an iterable,
by masklinn 1y ago
It's more between repeatable iterables and one-shot iterables (of which iterators are a subset, as iterators are iterable). For instance a file is an iterable, but (unless it's seekable and you rewind it) it'll only let you iterate once.
Basically what Go calls an iterator most other language call an iterable. Because it uses internal iteration, Go doesn't hand out iterators (save through iter.Pull).