The C <code>free()</code> API means memory allocation must save some metadata

Converting HTTP requests to Wiremock stubs, with Go

If you're using Wiremock, sometimes you want to be able to quickly generate stub mappings from an existing server, rather than hand-crafting it yourself, to give you a like-for-like stub. I've written the following - somewhat hacky - script to produce a Wiremock stub mapping from...

Learning a new language, or how I gained familiarity with Go

Every so often, engineers need to pick up a new language. After ~6 years of professional development using Java, with a bit of Ruby sprinkled in, coming to Deliveroo meant that I'd be starting to work on some Go codebases. So when it came to accepting the offer, I ended up thinki...

Rob Pike's simple C regex matcher in Go

Translating Rob Pike's simple and elegant C regex matcher to Go.

SSH Tips and Tricks

Since I joined Charm, I&rsquo;ve been working and learning more about SSH, and I thought I would share a few quick tips and tricks with you. Forward Yubikey Agent If you use a Yubikey (you should), you can use it in your remotes by having the key in a SSH agent and forwarding it....

The ‘fat service’ pattern for Go web applications

In this post I'd like to talk about one of my favorite architectural patterns for building web applications and APIs in Go. It's kind of a mix between the service object and fat model patterns &mdash; so I mentally refer to it as the 'fat service' pattern, but it might have a mo...

The pervasive effects of C's malloc() and free() on C APIs

Error handling with Go tooling

Most tutorials on Go tooling (and probably most other tooling) tend to focus on the happy path - the input code is perfectly valid and contains no errors. This is often a reasonable assumption, because we tend to run tools on existing code bases, and these are likely to compile c...

Releasing a Go library for content-type negotiation

As I've written about in the past, I'm a big fan of using Server-Driven Content Negotiation for APIs for versioning, but also find it handy for being able to serve different representations of data depending on what the client supports. This is handy to be able to serve an HTML p...

Tools I use to build my website

How I build my website benhoyt.com with GitHub Pages, Jekyll, a simple HTML+CSS layout, Sublime Text, and Sublime Merge.