Reading List

The most recent articles from a list of feeds I subscribe to.

Reflections on starting a limited company in Sweden

I saw this post linked on Hacker News today, reflecting on the difficulties of starting a company in Germany.

It made me think about the process of starting a company (“Aktiebolag”, or “AB”) in Sweden, which I recently went through myself.

`json.Marshal()` with additional fields in Go

I have a Go struct that I want to encode to JSON with some additional fields.

The struct looks like this:

`json.Marshal()` with additional fields in Go

I have a Go struct that I want to encode to JSON with some additional fields.

The struct looks like this:

How I'm testing MongoDB calls in Go (for now)

I started working on a little hobby project over this Easter vacation that makes use of MongoDB. But one thing I wasn’t sure about was how to test Mongo operations. Spanner provides the very helpful spannertest package. Redis has miniredis, allowing you to spin up a little Redis instance for each test. I was thinking I’d likely have to mock Mongo myself, but it turns out its Go driver comes with a helpful (but unstable!) mocking package called mtest. I learned about this in this post and suggest checking it out if you’re curious about this experimental mocking feature of mongo-go-driver.

How I'm testing MongoDB calls in Go (for now)

I started working on a little hobby project over this Easter vacation that makes use of MongoDB. But one thing I wasn’t sure about was how to test Mongo operations. Spanner provides the very helpful spannertest package. Redis has miniredis, allowing you to spin up a little Redis instance for each test. I was thinking I’d likely have to mock Mongo myself, but it turns out its Go driver comes with a helpful (but unstable!) mocking package called mtest. I learned about this in this post and suggest checking it out if you’re curious about this experimental mocking feature of mongo-go-driver.