A Delve Debugger Cheatsheet Mar 02, 2025Debuggers tend to go overboard with features and subcommands. This Delve cheatsheet lists the most important commands that cover 90% of all use cases.
Is []*T faster than []T? Nov 04, 2023Is a slice of values faster than a slice of pointers? Does it even matter?
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.