<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Done Channel on A Blog for the Uninitialized</title><link>https://www.nilpointer.blog/tags/done-channel/</link><description>Recent content in Done Channel on A Blog for the Uninitialized</description><generator>Hugo</generator><language>en-us</language><copyright>&lt;a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank" rel="noopener"&gt;Licensed under Apache 2.0&lt;/a&gt;</copyright><lastBuildDate>Fri, 27 Feb 2026 14:29:51 -0800</lastBuildDate><atom:link href="https://www.nilpointer.blog/tags/done-channel/index.xml" rel="self" type="application/rss+xml"/><item><title>Using the "done" channel in Go</title><link>https://www.nilpointer.blog/posts/2026/02/using-the-done-channel-in-go/</link><pubDate>Fri, 27 Feb 2026 14:29:51 -0800</pubDate><guid>https://www.nilpointer.blog/posts/2026/02/using-the-done-channel-in-go/</guid><description>&lt;p&gt;I wanted to document how a &lt;code&gt;done&lt;/code&gt; channel is most commonly used.&lt;/p&gt;
&lt;p&gt;Mainly because I&amp;rsquo;ve personally found it to be more confusing than it should be.&lt;/p&gt;
&lt;p&gt;It usually looks a bit like this, when following a worker pattern:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;func main() {
 var doneCh = make(chan struct{})

 // Perform some concurrent work
 // ...

 // Wait on that work
 for i := 0; i &amp;lt; 10; i++ {
 &amp;lt;-doneCh
 }
 
 // complete
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I intentially left out a bit here to highlight what a &amp;ldquo;done&amp;rdquo; channel actually looks like.&lt;/p&gt;</description></item></channel></rss>