Calculating Download MD5 Hash

Introduction One of the exercises I give to students is to download a single big file over HTTP concurrently using several goroutines using HTTP Range requests. An extra part of the exercise is to validate the downloaded file from a known MD5 signature. This extra part turns out...

Rust Programming Language: Simple Game

with Cheikh Seck Introduction This is the first in a series of posts that will explore the Rust programming language. I am going to take the same approach I did with Go and write little programs that explore the different features of the language. Before I begin that work, I thou...

How to use the http.ResponseController type

One of my favorite things about the recent Go 1.20 release is the new http.ResponseController type, which brings with it three nice benefits: You can now override your server-wide read and write deadlines on a per request basis. The pattern for using the http.Flusher and http...

Interfaces 101 : Interface Type Assertion Ep. 6

Introduction In episode 5, Miki wrote a function that counted the number of lines in a file with interfaces. The first thing his function did was to open a file with Go’s os.Open function. Miki chose this method because the variable returned by said function implements the io.R...

An unexciting idea: Code changes have context

Announcing GoReleaser v1.16 — the late February release

The February release got a little late… better later than even later, I guess! 😄 goreleaser healthcheck It is packed with some juicy features and tons of bug fixes and quality-of-life improvements. Let’s take a look: Highlights On GoReleaser Pro y...

Getting a `--version` flag for Cobra CLIs in Go, built with GoReleaser

Update 2023-05-27: If you're looking for an option that works with GoReleaser and go installs, check out my more recent post Getting a --version flag for Cobra CLIs in Go. As part of working on my new Go CLI dmd, I wanted to implement a --version flag to be able to check what ver...

Interfaces 101 : Determine LOC with io.Writer Ep. 5

Introduction In episode 4, Miki defined an enumerated type that satisfied Go’s fmt.Stringer interface. By implementing the fmt.Stringer interface, Miki can specify how his enumerators were printed within a formatted string and in this case, he expected the values to be displaye...

From Go on EC2 to Fly.io: +fun, −$9/mo

How I switched hosting my Go-based side projects from Amazon EC2 to Fly.io, significantly simplified deployment, and saved a bit of cash while I was at it.

Cross-compiling a CGO project using Goreleaser

While working on creating a new Go CLI dmd, I wanted to set up Gorelaser to make builds much simpler, as I wanted to be able to use this with both my Linux machine and my work Mac. I thought I had it working until I realised that I was using a library that required CGO to be buil...