Concurrency

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.

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.

Don't Select the Default

In a select block, don't be tempted to add a default case as a "fallback" or it might turn into a busy loop.