<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Go on jfx's site</title><link>https://jfx.ac/tags/go/</link><description>Recent content in Go on jfx's site</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 21 Apr 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://jfx.ac/tags/go/index.xml" rel="self" type="application/rss+xml"/><item><title>Iterators and Generators in Go</title><link>https://jfx.ac/blog/go-iterators-and-generators/</link><pubDate>Sun, 21 Apr 2024 00:00:00 +0000</pubDate><guid>https://jfx.ac/blog/go-iterators-and-generators/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Something I&amp;rsquo;ve found missing in Go is built-in generator functions and an
iterator interface. Python &amp;amp; JavaScript both have them and I find myself using
them regularly. Having syntactic sugar to express a generator &amp;amp; iterators is
great for consistency sake, and also makes them more accessible for
implementers.&lt;/p&gt;
&lt;h2 id="what-are-generator-functions"&gt;What are generator functions?&lt;/h2&gt;
&lt;p&gt;A generator function produces values on the fly or &amp;ldquo;lazily&amp;rdquo;, instead of
generating them all at once and storing them in memory.&lt;/p&gt;</description></item></channel></rss>