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.

Plugins case study: Envoy WASM extensions

Envoy is a configurable proxy that serves a prominent role in modern cloud-native projects; for example, it's used in many k8s deployments to provide inter-service communication (through Istio). In this post, I'd like to describe Envoy's extension mechanism as a case study of usi...

Introducing `openapi-sorbet`, a command-line tool for generating Sorbet types from OpenAPI

For a couple of the Ruby on Rails applications I work on at work, we use Sorbet for type checking. Late last year we were integrating a JSON Schema based Lambda with the Rails application, so needed to create models to interact with it. I started hacking on a command-line tool to...

Getting a `--version` flag for Cobra CLIs in Go

In my post Getting a --version flag for Cobra CLIs in Go, built with GoReleaser I wanted to add a --version flag to my Go command-line tools. However, I noted that this solution only works when using GoReleaser, and doesn't work when built from source. Fortunately this week Carla...

That people produce HTML with string templates is telling us something

How to include Git version information in Go

TL;DR: Just import github.com/carlmjohnson/versioninfo and use versioninfo.Revision to automatically include a Git hash in your Go application. Curious how it works? Want to make your own version info package? Read on. In previous blog posts, I’ve written about how you can inc...

Demystifying Tupper's formula

A book I was recently reading mentioned a mathematical curiosity I haven't seen before - Tupper's self-referential formula. There are some resources about it online, but this post is my attempt to explain how it works - along with an interactive implementation you can try in the...

The Lazy engineer's guide to running your Go web application to AWS Lambda

One of the things I really love about Go's structural typing is how interfaces work. It took a bit of getting used to it coming from Java, but I really enjoy the fact that just by implementing a method, you can call it a day. For instance, if you want to implement an HTTP server,...

Some notes on the cost of Go finalizers (in Go 1.20)

Which OS and CPU architecture is this binary compiled for?

Let's say that we have three binaries, and we want to detect the Operating Systems and CPU architectures in use: ls dmd dmd-darwin dmd.exe url If we run this through the file command, we can see the following information: $ file dmd dmd: ELF 64-bit LSB executable, x86-64, version...