Spotlights

Short tips, essays, and news about working with Go and software development. Most spotlights originate from my Go newsletter.

New in Go 1.25: WaitGroup.Go()

WaitGroups are a means of synchronizing goroutines; yet the Add()/defer Done() idiom feels clumsy and is error-prone. A new method, Go(), puts an end to goroutine counting.

The Synctest Package (new in Go 1.25)

Tests that rely on time.Sleep() to test timings can be unreliable and slow. The synctest package introduces two antidotes: fake time and

Atomic Functions or Methods

The sync/atomic package recommends using atomic types and their methods instead of the package-level atomic functions. For good reasons.

WebAssembly in 5 Minutes

Compiling Go code into a WebAssembly module is easy as pie. Getting the code to interact with the browser requires a few lines of Javascript, but it's less complicated than you might think.