Iterators in Go
from nebiros@programming.dev to golang@programming.dev on 07 Aug 2023 18:16
https://programming.dev/post/1431051

Iterators in Go

This article describes a proposed extension to the Go language: range over func. The proposal is evolving, and this tutorial is a work in progress, so don’t forget to check back later for the latest developments.

#golang

threaded - newest

SleepyHarry@sh.itjust.works on 12 Aug 2023 13:59 collapse

The syntax strikes me as a little clunky, but I do like the idea. Coming from Python I’ve used generators a lot (which in my obviously biased opinion is a clearer name that “iterator” here) so recognise the value in having something like that in the language.

nebiros@programming.dev on 13 Aug 2023 17:37 collapse

probably they gonna end up with its own generic type at the stdlib