Iota in Go: a quick introduction

iota is a neat feature of Go that lets us create “enums”: lists of constants with arbitrary values. Let’s find out how to use iota, with this quick tutorial. | Continue reading


@bitfieldconsulting.com | 18 days ago

Programming with confidence: TDD in Go

There’s an easy, pleasant, and reliable way to build software in Go, guided by tests. Let’s find out what it’s like to program with confidence, in the first part of this TDD tutorial series. | Continue reading


@bitfieldconsulting.com | 1 month ago

Master of my domain

Let’s talk business—independent business, that is. What’s the cost of being the boss? Some more hard-learned lessons from my own horrible career. | Continue reading


@bitfieldconsulting.com | 2 months ago

Cryptography in Go: AES internals

AES is the modern standard encryption algorithm, but how does it work? Where does it come from? Let’s kick the tyres with a high-level overview of AES internals. | Continue reading


@bitfieldconsulting.com | 3 months ago

Being a good co-worker is your job now

In the final part of this series on the world of work, we’ll talk about how not to suck at meetings. | Continue reading


@bitfieldconsulting.com | 3 months ago

Not a real developer

In the second part of my tell-all memoir, we find out why I was constitutionally unsuited to employment in a structured environment, or indeed any environment. | Continue reading


@bitfieldconsulting.com | 4 months ago

People skills for developers

In the second part of this series on career skills for software engineers, we’ll look at how to deal with that trickiest of species: human beings. | Continue reading


@bitfieldconsulting.com | 5 months ago

My horrible career

Dev advocate Zack Proser grilled me lightly about my career, and why I haven’t taken any of my own advice. Read the full interview, but pay no attention to the man behind the curtain. | Continue reading


@bitfieldconsulting.com | 6 months ago

You can do this: surviving day one

It’s day one of your new job as a developer. What should you expect? How should you act? Will you survive “max Q“? | Continue reading


@bitfieldconsulting.com | 7 months ago

Iterators in Go

The iterator proposal is a neat way to write “lazy loops”, where we never generate more results than we actually use. Let’s see what that would look like in Go programs. | Continue reading


@bitfieldconsulting.com | 9 months ago

Finding bugs with fuzzing

In the thrilling conclusion to our fuzz testing series, we’ll use Go’s fuzzer to find a real bug in our code, and also to verify the fix. | Continue reading


@bitfieldconsulting.com | 9 months ago

Writing a Go fuzz target

Let’s continue our exploration of fuzz testing in Go with a look at how to write a fuzz target for a (nearly) realistic function. This time we’ll try to detect a common kind of bug involving a confusion between runes and bytes. | Continue reading


@bitfieldconsulting.com | 10 months ago

Fuzz tests in Go

Fuzz testing is Go’s clever way of generating new test inputs that you didn’t think of—and that may flush out some hidden bugs. Stand by for things to get a little fuzzy! | Continue reading


@bitfieldconsulting.com | 11 months ago

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. | Continue reading


@bitfieldconsulting.com | 1 year ago

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. | Continue reading


@bitfieldconsulting.com | 1 year ago

A generic Set type in Go

To celebrate the first anniversary of generics in Go, let’s build something practical and useful: a generic Set type, and add some neat methods to it. Ready for fun? | Continue reading


@bitfieldconsulting.com | 1 year ago

From packages to commands

In Part 2 of a series about writing packages, not programs, we see how to test a package that prints to the terminal, and use the result to build our “hello, world” CLI tool. | Continue reading


@bitfieldconsulting.com | 1 year ago

Write packages, not programs

Go ships with a great standard library of packages, and that’s a clue to the power of re-usable software components. What would it mean, then, to think about our work not merely as building one-off programs, but as contributing to the universal Go library? | Continue reading


@bitfieldconsulting.com | 1 year ago

The gentle art of code review

Could we give and receive code reviews with kindness, gentleness, humility, and compassion? Can we make a point without making an enemy? Let’s go line by line. | Continue reading


@bitfieldconsulting.com | 1 year ago

Executable examples in Go

Did you know that Go lets us provide executable code examples as part of our documentation? It’s pretty neat. Let’s take a tour of this useful feature and see how it works. | Continue reading


@bitfieldconsulting.com | 1 year ago

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. | Continue reading


@bitfieldconsulting.com | 1 year ago

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. | Continue reading


@bitfieldconsulting.com | 1 year ago

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. | Continue reading


@bitfieldconsulting.com | 1 year ago

Conditions and concurrency in test scripts

Continuing our series on the testscript package, we look at some advanced techniques in test scripts such as conditions, concurrency, and managing environment variables. | Continue reading


@bitfieldconsulting.com | 1 year ago

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? | Continue reading


@bitfieldconsulting.com | 1 year ago

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 . | Continue reading


@bitfieldconsulting.com | 1 year ago

Functional programming in Go

Thanks to generics, there are some interesting new ways to program in Go. This article explains how we can use functional programming techniques like Map, Filter, and Reduce, and what kind of problems they might help us to solve. | Continue reading


@bitfieldconsulting.com | 1 year ago

Demystifying Go's 'Defer' Statement

The defer keyword in Go can seem mysterious at first: why do we need it? How do we use it? Let’s explore some common patterns that use defer to build robust, efficient programs by preventing resource leaks. | Continue reading


@bitfieldconsulting.com | 1 year ago

Test names should be sentences

Tests communicate a lot of information, to readers, other developers, and even our future selves. Well-written tests focus on a single unit of behaviour that can be described in a brief sentence, and we can use that sentence as the name of the test. | Continue reading


@bitfieldconsulting.com | 1 year ago

Test Scripts in Go

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. | Continue reading


@bitfieldconsulting.com | 1 year ago

Testing CLI tools in Go

The testscript package gives us an easy way to test the behaviour of a Go CLI tool, by executing it as an independent binary. Let’s see how. | Continue reading


@bitfieldconsulting.com | 1 year ago

So you're ready for green belt?

If you’re a BIT student, are you ready for your green belt test? If you’re studying independently, check your Go skills and see whether you’d pass this demanding certification. | Continue reading


@bitfieldconsulting.com | 1 year ago

VS Code and Go: a superhero's guide

Visual Studio Code is the most popular Go editor, and no wonder: it’s the Batman’s utility belt of editors. Let’s cape up and take a tour of VS Code’s Go superpowers. | Continue reading


@bitfieldconsulting.com | 1 year ago

Golang training at BIT

The Bitfield Institute of Technology (BIT) is a software engineering school that offers remote training and certifications in Go development to students worldwide. | Continue reading


@bitfieldconsulting.com | 1 year ago

Ten 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. | Continue reading


@bitfieldconsulting.com | 1 year ago

Don't write clean code, write CRISP code

“Clean code” is so over: all the cool kids are switching to CRISP code . I’ll show you how to achieve it in five catchy, T-shirt-friendly slogans. | Continue reading


@bitfieldconsulting.com | 2 years ago

An API client in Go

The internet is very big, and a vast ocean of network resources lies undiscovered before us. Let's dip a hook into that ocean now and see what we can catch with an API client in Go. | Continue reading


@bitfieldconsulting.com | 2 years ago

Scripting with Go

The Unix shell is pure wizardry. Why shouldn’t it be easy to write systems programs in Go as it is in the shell? The script library is the secret spell-book that makes this possible. | Continue reading


@bitfieldconsulting.com | 2 years ago

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? | Continue reading


@bitfieldconsulting.com | 2 years ago

Type parameters in Go

Now that generics have come to Go, let's take a look at the new syntax for type parameters . We’ll find out why we need type parameters, how we write them, and how we can use them to create generic functions and types in Go. | Continue reading


@bitfieldconsulting.com | 2 years ago

Best Go books for 2022

What are the best Go books for 2022? Read my (relatively) unbiased recommendations for the Go books you should absolutely buy and read right now, whether you’re a beginner or expert Gopher. | Continue reading


@bitfieldconsulting.com | 2 years ago

Walking with filesystems: Go's new fs.FS interface

The new io/fs package in Go 1.16+ gives us a powerful new way of working with filesystems . Walk with me, then, as we take a tour of the new fs.FS interface and see what it can do. | Continue reading


@bitfieldconsulting.com | 2 years ago

Review: 'Let's Go Further'

Alex Edwards’s new book Let’s Go Further is both an essential reference for Go developers and a valuable compendium of battle-tested knowledge about using Go in practice. Read my review to learn more. | Continue reading


@bitfieldconsulting.com | 2 years ago

Writing Slower Go Programs

Optimizing Golang code for performance is almost certainly a waste of your time, for several reasons: performance doesn’t matter, Go is fast, and readability is more important than speed. You can buy a faster computer, but you can’t buy a faster brain. | Continue reading


@bitfieldconsulting.com | 2 years ago

Don't Fear the Pointer

Pointers in Go sound scary, but they’re actually very straightforward. Let’s find out what they are, why we need them, and what to watch out for. | Continue reading


@bitfieldconsulting.com | 2 years ago

Wax on, wax off: the six levels of Go dev skills

Are you a grasshopper or a Go sensei? Can you wax on, wax off? Go mentor and would-be Mr Miyagi, John Arundel, explains how he grades his students using a system of coloured belts like those used in the martial arts. Find out how your skills compare to typical junior, mid-level, … | Continue reading


@bitfieldconsulting.com | 2 years ago

“How dare they not recognise my incipient genius?”

The illustrious Bill Kennedy and I had a really fun and interesting conversation about my career in software engineering, consulting, and writing, for the Ardan Labs podcast. | Continue reading


@bitfieldconsulting.com | 2 years ago

Incident response: “The next 16 minutes are going to get intense”

When his phone wakes him at two in the morning, operations engineer Andy Pearson knows it’s bad news. There’s a major server problem, and hundreds of client websites are down. The next sixteen minutes are going to get intense. | Continue reading


@bitfieldconsulting.com | 2 years ago