Reading List
The most recent articles from a list of feeds I subscribe to.
`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
.
Experimenting with remote work locations
With my third booster shot out of the way I’ve felt a bit safer finally going out into the world a bit more and actually experimenting with different work locations. One of the things I love about remote work is being able to work from anywhere, but throughout the pandemic it was impossible to explore this possibility because it simply wasn’t safe to do anything but stay at home.