Skip to main content

Archived Posts

2022

Dependency Injection Explained

An explanation of Dependency Injection in Go and why it's useful.

2021

Trying Out Generics in Go

Converting a library that used code generation to generics in Go 1.18

Switching My gRPC Project to Use Buf

My experience switched my gRPC backed project's protofiles to use Buf

4 Things to Consider When Choosing a Go API Framework

Four things to think about when choosing an API framework to write your next Go service.

Writing Tests for Your Database Code in Go

How To Write Tests for Your Database Code in Go Without Mocking SQL

2020

Reading 26 Books a Year

Setting a personal goal to read 26 books in a year with a system for retention using notes and summaries.

Handling Errors in Your HTTP Handlers

A pattern for returning errors from Go HTTP handlers to reduce boilerplate and centralize error handling.

2019

Profiling to Reduce Memory Allocations

Using pprof and go tool trace to find and fix a 100x memory allocation issue caused by compression middleware.

Speed Up Your Go Builds With Actions Cache

How to configure GitHub Actions caching for Go modules and build cache to speed up your CI pipelines.

Migrating From Travis to GitHub Actions

A walkthrough of migrating a Go project's CI/CD pipeline from Travis CI to GitHub Actions with matrix builds, services, and releases.

How to Take Three Years to Finish Your Side Project

Lessons learned from spending three years building Flipt, including mistakes to avoid and launching before you feel ready.

2017

Testing API Clients in Go

4 Tips for Testing Your API Client

Option Types with go generate

Creating Option types in Go without generics using go generate, templates, and golden file testing.

2016

Functions as State

Using recursive function types to implement elegant state machines in Go, inspired by Rob Pike's lexical scanning talk.

Writing a Ray Tracer in Go - Part 5

Final part: adding glass materials with refraction, a movable camera, field of view, and runtime configuration with Go flags.

Writing a Ray Tracer in Go - Part 4

Introducing materials with Lambertian diffuse reflection and specular metal surfaces with fuzz coefficients.

Writing A Ray Tracer in Go - Part 3

Adding shading with surface normals, implementing anti-aliasing with sampling, and refactoring with Go interfaces.

Writing A Ray Tracer in Go - Part 2

Implementing rays, spheres, and ray-sphere intersection to render a red sphere on screen.

Writing a Ray Tracer in Go

Part 1 of building a path tracer in Go. Covers the difference between ray and path tracing and outputs a first test image.