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.

Scripting with Go

The Unix shell is pure wizardry. Why shouldn’t it be as 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.

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.

Demystifying 'defer'

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.

Review: 'Learning Go'

Jon Bodner’s ‘Learning Go’ is simply the best single-volume Go book for experienced developers, and I don’t say that lightly. This book will give you a better, wider, deeper, and certainly more up-to-date knowledge of Go than any other.

Ten commandments of Go

I spend a lot of time working with students to help them write clearer, better, and more useful Go programs, using a fairly small set of general principles, and here they are. The first is “be boring”, and I’ve tried to follow that advice.

How to really learn Go

Learning is hard. How do you plan, study, organise your time, and build the right habits? Master teacher John Arundel gives ten helpful hints for students who want to really learn Go.

Go vs Python

Which is better, Python or Go? Which language should you learn today, and why? How do the two compare in performance, ease of learning, scalability, and rapid prototyping? Let's find out, in this friendly and accessible overview of Python and Go for beginners.

Are you a Go black belt?

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, and senior devs!

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.

Go maps FAQ

What is a map in Golang and how does it work? Are Go maps thread-safe? Are maps pointers? How do you check if a map is empty? Can maps be nil? Go teacher and expert John Arundel answers these and other questions about Go maps.

map[string]interface{} in Go

What is a map[string]interface{} or map[string]any in Go, and why is it so useful? How do we deal with maps of string to interface{} in our programs? What the heck is an interface{}, anyway?

Iterating over a Golang map

How do you iterate over Golang maps? How do you print a map? How do you write a for loop that executes for each key and value in a map? What is the iteration order of Go maps? Let's find out, in this practical, easy-to-follow tutorial.

Finding whether a Go map key exists

What happens if you look up a key in a Go map that doesn’t exist? How do you check if a key is present in a map? How do you represent a set of objects as a map in Golang, and efficiently check whether a given value is in the set?