Go Articles and Tutorials


Live Reload Go Projects with wgo
April 19, 2024

Live Reload Go Projects with wgo

Building web apps in Go is extremely rewarding. However, as Go’s a compiled language, to see changes, you need to restart the app. Needless to say that’s quite tedious! With live reloading, it doesn’t need to be.

Restrict HTTP Request Methods in Go 1.22
April 11, 2024

Restrict HTTP Request Methods in Go 1.22

Restricting HTTP request methods, when working with net/http prior to Go 1.22 was a little complicated. However, that’s all changed. Now, it’s pretty trivial. In this short tutorial, I’ll show you the new approach.

Debug Go Code with Visual Studio Code
April 27, 2024

Debug Go Code with Visual Studio Code

Recently, I started debugging Go code using Visual Studio Code. Some minor hiccups aside, it was pretty trivial to get up and going. This is the short version of what you need to do to get started.

Understanding Go's Empty Interface
April 12, 2023

Understanding Go's Empty Interface

Recently, while working with the Twilio Lookup API, I had the opportunity to properly learn about Go’s empty interface. During the process, I realised that I didn’t understand it properly, so took the opportunity to do so. Today, I am going to step through what it is and how simple they are to work with.

Restrict Allowed Route Methods in Go Web Apps
April 1, 2023

Restrict Allowed Route Methods in Go Web Apps

It’s incredibly easy to build web apps and APIs using Go’s net/http package. All you really need to do is to specify a route and its handler. But, how do you restrict the methods that routes can accept? In this short tutorial, I’ll show you how.

Go Interfaces Make Development and Testing Easier
April 21, 2023

Go Interfaces Make Development and Testing Easier

Substitutability or the Liskov Substitution Principle (LSP) is a concept that I’ve tried to adhere to for some years when writing code. It’s beneficial for many reasons, but particularly when testing, as it can indirectly force you to write code that is more testable. Recently, I’ve started appreciating how it works in Go, and will step through how in this short article.

Learning Golang, Day 9 – Go's Empty Interface.
April 20, 2022

Learning Golang, Day 9 – Go's Empty Interface.

Here we are on day 9. Today, I dove down a proverbial rabbit hole. While intending to learn more about Go’s Empty Interface, I ended up reading about Abductive and Deductive reasoning, and Duck, structured, and nominal typing.

Learning Golang. Day 6
April 16, 2022

Learning Golang. Day 6

Here we are on day 6 – the start of the week two. Today, was a slower day, where I focused on one topic, maps!

Learning Golang. Day 4
April 12, 2022

Learning Golang. Day 4

Here I am at day 4. Today, I learned about the range function and started the slices exercise…but got stuck.

Learning Golang. Day 2
April 10, 2022

Learning Golang. Day 2

Today was a slightly slower day for learning Go than was yesterday. However, I learned about flow control statements, and defer, panic, and recover.

Learning Golang. Day 1
April 9, 2022

Learning Golang. Day 1

For the longest time, I’ve been meaning to learn another software development language in-depth, in addition to my primary development language, PHP. I’ve decided that the language is Go.