Unnest with Reflection in Go

Recently at work I needed to write a utility to sync a PostgreSQL database with another data source. In my attempts to make the synchronization efficient, I came across a very helpful StackOverflow question which explained how to perform bulk insertions and updates. The recommended solution looked something like this:

[Read More]

Root Certificates Container

This website, like most of the services I host in my homelab runs in a Docker container which is hosted in a small Kubernetes cluster. I’ll go into more detail about the Kubernetes cluster in a later post. In this post I want to demonstrate a very simple container I have created which bundles the root certificates distributed with most operating systems, making them available to the application running within.

[Read More]

De-Duplicating Unit Test Setup

Go (or if you are using a search engine, Golang) has great unit testing functionality built directly into the language. Create a file ending in _test.go and define a function with the signature func TestMyFunction(*testing.T). Executing go test will now run any tests in the current package. Very easy. As an application grows however, the number of tests explodes and it maintaining organization becomes difficult. To solve this problem, while developing the new REST API at ExtraHop I began using GoConvey from the very gracious developers at SmartyStreets. [Read More]