Killing Me Softly, Or: How Goroutines Want To Exit Feb 16, 2025POSIX threads have an array of control functions, goroutines have none. When to exit is a goroutine's decision. Here's how to properly stop them from the outside.
Avoid Anonymous Types Feb 09, 2025Anonymous types may seem like a suitable shortcut for simple scenarios, but the drawbacks don't outweigh the (perceived) benefits.
Weak Pointers Jan 26, 2025I would have called them modest pointers. They are unobtrusive and don't leave any garbage behind.
Immediately Invoked Function Expressions Oct 20, 2023Define an anonymous function and invoke it right away: A pattern that is sometimes useful but hard to read and hence qualifies as 'clever, not clear'
Big Things Will Happen Jan 12, 2025You might feel powerless in the face of recent and upcoming disruptions. Think twice: Your Go skills are your secret weapon.
How To Verify Struct Initialization For Completeness Sep 10, 2023Go doesn't enforce struct initialization to be complete. A linter helps to catch half-baked initialization.
Distributing a Man Page With Goreleaser And Homebrew Dec 19, 2024Go CLI tools should come with a man page. Here is how to distribute a man page with Goreleaser and homebrew
Unpopular opinion: Go time format strings are not so bad after all Mar 16, 2024Go has an unconventional way of specifing time format. While time format strings can be confusing to construct, they are dead easy to read.
Did you know...? Go has a Diamond Problem! Apr 05, 2024In a diamond-shaped class hierarchy, methods can be ambiguous. Go has no class hierarchies, but struct embedding can cause a similar problem.
Does your CLI tool have a man page? Dec 12, 2024RTFM! But what if the CLI tool has no man page? Make your users happy by providing a manpage alongside your CLI app.