Dependency Injection Explained

Have you heard the term “Dependency Injection” before but struggled to really grok what it means? How do you properly do Dependency Injection in your Go applications and more importantly why? What does using Dependency Injection enable you to do and why is preferred over other me … | Continue reading


@markphelps.me | 2 years ago

Trying Out Generics in Go

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


@markphelps.me | 2 years ago

Switching My gRPC Project to Use Buf

Do you work with Protobufs and gRPC in your projects or at work? Have you ever been frustrated with the tooling, boilerplate setup, or wondered if you were doing things the right way ? Same. Good news! There is a better way. My own project Flipt has used Protobufs and gRPC/gRPC g … | Continue reading


@markphelps.me | 2 years ago

4 Things to Consider When Choosing a Go API Framework

So you’ve decided to write an API service in Go… great! One of the first things many newcomers to the language ask is, “Which framework should I use?”. Those coming from languages such as Ruby or Python may be familiar with a single web framework that is used by the majority of d … | Continue reading


@markphelps.me | 2 years ago

Writing Tests for Your Database Code in Go

Have you ever started writing an application in Go that reads and writes to a database only to later be confused about how to properly write tests for it? How do you ensure that your tests run quickly but are also effectively testing the edge cases? When and what do you mock in y … | Continue reading


@markphelps.me | 2 years ago

Reading 26 Books a Year

It’s that time of year where everyone seems to reflect on the year and set goals for the one to come. Looking back over 2020, I’m struggling to remember anything concrete that I can say I did for myself that improved my life in a meaningful way. Don’t get me wrong, I’ve had caree … | Continue reading


@markphelps.me | 3 years ago

Handling Errors in Your HTTP Handlers

It’s been a while since my last post, so I thought I would write about a pattern that I’ve come to like for handling errors in HTTP Handlers in Go.I’ve always enjoyed the simplicity of writing web services in Go. You create your http.HandlerFuncs, add them to your router or serve … | Continue reading


@markphelps.me | 4 years ago

Profiling to Reduce Memory Allocations

Make it work, make it right, make it fast. – Kent Beck Yesterday I decided to do some profiling of my open source Go project, Flipt, to try and find some low-hanging fruit that I could optimize to give some quick performance wins. This process allowed me to find some unexpected i … | Continue reading


@markphelps.me | 4 years ago

Speed Up Your Go Builds With Actions Cache

Updated 02/04/21 Thanks to an astute reader who reached out to me informing me why the tests didn’t run any faster post cache and also provided the fix! Noted below.In my previous post: https://markphelps.me/posts/migrating-from-travis-to-github-actions/ I described my journey mi … | Continue reading


@markphelps.me | 5 years ago

Migrating From Travis to GitHub Actions

Over the weekend I decided to move my CI pipeline from TravisCI to GitHub Actions for my open source Go project, Flipt. I wanted to replace my existing CI as well as automate a manual release process and to try an do it all with the new GitHub Actions.Full Disclosure: I work for … | Continue reading


@markphelps.me | 5 years ago

How to Take Three Years to Finish Your Side Project

Continue reading


@markphelps.me | 5 years ago

How to Take Three Years to Finish Your Side Project

It’s been almost 2 years since I’ve posted any content on this blog. One of the reasons for my hiatus is that I’ve been spending a lot of my extra energy on finishing my side project, Flipt, which I can best describe as a ‘self contained feature flag solution’.This post however i … | Continue reading


@markphelps.me | 5 years ago

Testing API Clients in Go

Let’s imagine you are building an API client in Go to make it easier for people to interact with your public REST API. Everything is going great. You’ve got authentication, pagination and awesome error handling in place. One thing that’s still unresolved though is how do you test … | Continue reading


@markphelps.me | 7 years ago

Option Types with go generate

This post is about a library and command I created called optional with the help of go generate. The code is here: https://github.com/markphelps/optional if you want to follow along.I’ve been coding in Go for some time now, and one thing I miss from my Java days is the ability to … | Continue reading


@markphelps.me | 7 years ago

Functions as State

Recently I’ve been working on a Slack bot project in Go using the wonderful nlopes/slack client. While nlopes makes it easy to post and consume messages to and from Slack, either via the Web API or Real Time API, I found myself struggling when trying to maintain conversation stat … | Continue reading


@markphelps.me | 7 years ago

Writing a Ray Tracer in Go - Part 5

This is the 5th and final post of my series on writing a ray/path tracer in Go. Check out the previous parts 1, 2, 3 and 4.I’m roughly following the e-book Ray Tracing in One Weekend, but translating all of the code into Go.All of the code for this post can be found on my Github. … | Continue reading


@markphelps.me | 8 years ago

Writing a Ray Tracer in Go - Part 4

This is part 4 of my series on writing a ray/path tracer in Go. Check out parts 1, 2 and 3.I’m roughly following the e-book Ray Tracing in One Weekend, but translating all of the code into Go.All of the code for this post can be found on my Github.Last time we added the ability t … | Continue reading


@markphelps.me | 8 years ago

Writing A Ray Tracer in Go - Part 3

This is part 3 of my series on writing a ray/path tracer in Go. Checkout parts 1 and 2.I’m roughly following the e-book Ray Tracing in One Weekend, but translating all of the code into Go.All of the code for this post can be found on my Github.Last time I covered the basics of cr … | Continue reading


@markphelps.me | 8 years ago

Writing A Ray Tracer in Go - Part 2

This is part 2 of my journey to try and write a ray/path tracer in Go. Checkout part 1 here.I’m roughly following the e-book Ray Tracing in One Weekend, but translating all of the code into Go.In the previous post we covered how a path tracer works and got an image to display on … | Continue reading


@markphelps.me | 8 years ago

Writing a Ray Tracer in Go

I’ve been wanting to learn Go for awhile now. I bought a book, read several blogs and tutorials, but I still didn’t feel like I was really getting anywhere with the language.A few weeks ago I went with my a few of my co-workers to the Triangle Golang meetup hosted by my friend Br … | Continue reading


@markphelps.me | 8 years ago