• I've changed the title to something slightly less click-baity.


    On the article itself, I do find it strange that people first reach for mocks (essentially rewriting complex things like a db or api server) instead of just running a dev or local version of the service they want to test instead for integration tests. IMO unit tests should never touch the network, and integration tests should accept that they need to test the entire stack including network calls (local or otherwise) - there are utilities in go already for testing handlers with real requests which record the response for you, and for testing requests your app makes you can just run a simple server in your tests, as they end up doing here. The fewer mocks the better.