The Tao of Go

What is the Tao of Go, and how can we work with it, like a surfer going with the waves instead of struggling against them? By being kind, simple, humble, and not striving; here’s how.

Random testing in Go

Choosing good test cases for our Go programs can be a bit hit-and-miss. What if we could automate that process? Let’s talk about randomisation, property-based testing, and Go’s built-in fuzz testing feature.

The adapter pattern in Go

How do you test a database without a database? Don't worry, this isn't one of those Zen puzzles. I have something more practical, but equally enlightening, in mind. Let’s use the adapter pattern to solve the riddle.

A career ending mistake

As software engineers, we're constantly making detailed, elaborate plans for computers to execute. Isn't it weird that we rarely give a moment's thought to the program for our own careers?

Error wrapping in Go

Distinguishing between specific error values and types is easy in Go, thanks to the (relatively) new errors.Is and errors.As functions. Let’s talk about what they do, when and how to use them, and how to know which one is appropriate.

Standalone test scripts

Wouldn't it be nice if we could run test scripts directly from the command line? The standalone testscript tool does exactly that. Let’s see how to use it to create simple, self-contained issue repros.

Comparing Go error values

Usually what matters about an error is that it’s not nil, but what if we want to know whether it’s some specific error value? For example, in a test? Let’s look at some of the right and wrong ways to do that.

Testing errors in Go

How should we test errors in Go? And how does the need for this testing influence the way we construct, handle, and pass around errors within our Golang programs?

Files in test scripts

The txtar format is an ingenious way to supply arbitrary files and folder structures to test scripts. We’ll also learn about file management, simulating standard input, and breaking up scripts into phases.

Flipping the script

Wouldn’t it be great if we could write tests for our Go CLI tools that are simple as shell scripts? The testscript package lets us do exactly that. Let’s take it for a spin.

Tips for Time Lords

Being a Time Lord isn't about which planet you're born on, or whether you can regenerate. You don't even need a sonic screwdriver. All you need to do is think effectively, and do the right things, in the right way, at the right time. Here’s how.