Lanzado el 10 de febrero de 2026
The Go Blog Testing Time (and other asynchronicities) In Go 1.24, we introduced the testing/synctest package as an experimental package. This package can significantly simplify writing tests for concurrent, asynchronous code. In Go 1.25, the testing/synctest package has graduated from experiment to
<div id="blog"><div id="content"> <div id="content"> <div class="Article" data-slug="/blog/testing-time"> <h1 class="small"><a href="/blog/">The Go Blog</a></h1> <h1>Testing Time (and other asynchronicities)</h1> <p class="author"> Damien Neil<br> 26 August 2025 </p> <div class='markdown'> <p>In Go 1.24, we introduced the <a href="/pkg/testing/synctest"><code>testing/synctest</code></a> package as an experimental package. This package can significantly simplify writing tests for concurrent, asynchronous code. In Go 1.25, the <code>testing/synctest</code> package has graduated from experiment to general availability.</p> <p>What follows is the blog version of my talk on the <a href="/pkg/testing/synctest"><code>testing/synctest</code></a> package at GopherCon Europe 2025 in Berlin.</p> <h2 id="what-is-an-asynchronous-function">What is an asynchronous function?</h2> <p>A synchronous function is pretty simple. You call it, it does something, and it returns.</p> <p>An asynchronous function is different. You call it, it returns, and then it does something.</p> <p>As a concrete, if somewhat artificial, example, the following <code>Cleanup</code> function is synchronous. You call it, it deletes a cache directory, and it returns.</p> <pre><code>func (c *Cache) Cleanup() { os.RemoveAll(c.cacheDir) } </code></pre> <p><code>CleanupInBackground</code> is an asynchronous function. You call it, it returns, and the c
Genera un resumen en lenguaje claro de los cambios de este release, pensado para desarrolladores.