this post was submitted on 07 Aug 2023
10 points (100.0% liked)

Golang

27 readers
1 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 1 year ago
MODERATORS
 

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.

top 2 comments
sorted by: hot top controversial new old
[–] SleepyHarry 2 points 1 year ago (1 children)

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.

[–] [email protected] 1 points 1 year ago

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