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.

2 points

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.

permalink
report
reply
1 point

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

permalink
report
parent
reply

Golang

!golang@programming.dev

Create post

This is a community dedicated to the go programming language.

Useful Links:

Rules:

  • Posts must be relevant to Go
  • No NSFW content
  • No hate speech, bigotry, etc
  • Try to keep discussions on topic
  • No spam of tools/companies/advertisements
  • It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Community stats

  • 34

    Monthly active users

  • 146

    Posts

  • 148

    Comments