<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Go on Steven&#39;s blog</title>
    <link>https://landow.dev/tags/go/</link>
    <description>Recent content in Go on Steven&#39;s blog</description>
    <generator>Hugo -- 0.152.2</generator>
    <language>en</language>
    <lastBuildDate>Tue, 13 Jan 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://landow.dev/tags/go/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>debugging Go deadlocks</title>
      <link>https://landow.dev/posts/go-deadlocks/</link>
      <pubDate>Tue, 13 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://landow.dev/posts/go-deadlocks/</guid>
      <description>&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; I made this into a small Go module: &lt;a href=&#34;https://github.com/stevenctl/deadlog&#34;&gt;https://github.com/stevenctl/deadlog&lt;/a&gt;.
It is a drop in replacement for &lt;code&gt;sync.Mutex&lt;/code&gt; and &lt;code&gt;sync.RWMutex&lt;/code&gt;, with the option to call the returned &lt;code&gt;unlock&lt;/code&gt; closure
if you want to track unreleased locks. Don&amp;rsquo;t run with this in production, it&amp;rsquo;s only for debugging deadlocks.&lt;/p&gt;
&lt;p&gt;Multiple times, I&amp;rsquo;ve had to debug deadlocks in some Go code. Even though Go&amp;rsquo;s
&lt;code&gt;-race&lt;/code&gt; flag when running tests can detect deadlocks, in my experience it
hasn&amp;rsquo;t caught the ones that drive me crazy with flaky or fast tests
(~500ms-2s).&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
