All tagged golang

Rust vs Go in 2025

Which is a better choice, Rust or Go? Which language should you choose for your next project, and why? How do the two compare in areas like performance, simplicity, safety, features, scale, and concurrency?

Constraints in Go

Freedom is nothing without constraints, and Go’s generics gives us a powerful way to build polymorphic types and functions constrained by type sets. Let’s geek out.

Generic types in Go

What kind of idiot would carry a package for someone when they've absolutely no idea what's inside it? Well, generic types in Go are exactly like that, only in a good way.

Programming is fun

I was a guest on the Cup o’ Go podcast recently, talking with Shay Nehmad and Jonathan Hall about writing and teaching Go. Here’s a transcript of our chat.

Iterators in Go

Iterators in Go are 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, and what new facilities it gives us in the standard library.

Shameless green

Building software is easy when we’re guided by tests, because we can start with quick-and-dirty solutions, without worrying about whether the code is elegant and readable—yet. Let’s see how to use the TDD technique called “Shameless Green”.

Programming with confidence

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.

Generics in Go

Generics what now? This friendly, down-to-earth tutorial series explains how Go’s generic functions and types work, why we need them, and where we can use them.

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.

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!

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.