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.
GNU Style Flags—Almost Jun 14, 2024To have GNU-style short and long flags, you don't have to reach out to third-party packages. Go's flag package can handle double-dash, long-name flags.
Property Testing: Beyond Matching Input-Output Pairs Dec 01, 2024How to test properties of a function call that hold true for any input