Uploaded December 2024 | Updated December 2026, 3 days ago
We all write tests, at least we all should be writing tests. Some of us - many of us? maybe even most of us - like to use mocks/fakes/etc. to insulate our tests from slowness and/or flakiness due to "external" dependencies. This talk will cover how I, an experienced and quite opinionated Gopher, structure my projects to accommodate test mocks, either generated or hand-written, while allowing for flexibility in the "how" across projects or even between packages within the same project. By following just a few simple strategies, you too can "mock" Go code without angering your co-workers.
We all write tests, at least we all should be writing tests. Some of us - many of us? maybe even most of us - like to use mocks/fakes/etc. to insulate our tests from slowness and/or flakiness due to "external" dependencies. This talk will cover how I, an experienced and quite opinionated Gopher, structure my projects to accommodate test mocks, either generated or hand-written, while allowing for flexibility in the "how" across projects or even between packages within the same project. By following just a few simple strategies, you too can "mock" Go code without angering your co-workers.







