This is a collection of some small go packages that were useful enough for me to include them in more than one project. It contains:
log- An adapter for third party logging libraries.
slugify- Generate url's from titles.
smtp- Simple wrapper around the smtp package in the standard library.
test- Minimalist set of functions for unit testing.
Code can be found here.
My take on logging in go
The subject of logging comes up every now and then, in every group of developers. Apparently it is something to be opinionated about, like code formatting. Or to something complain about, like leaving off the cap of the toothpaste. If only there was a go fmt for logging. Or toothpaste.
Unit test outbound HTTP requests in go
In general, when one wants to test the interaction of multiple services and systems, one tries to set up an integration test. This often involves spinning up some Docker containers and a docker-compose file that orchestrates the dependencies between them and starts the integration test suite. In other words, this can be a lot of work.