4 ms·
I also use that same pattern. I'm very tempted to write a tool to be called by `go generate` to automatically create that kind of mock.
by piinbinary 9y ago
I also use that same pattern. I'm very tempted to write a tool to be called by `go generate` to automatically create that kind of mock.
- PopsiclePete 9y agoPlease don't. I mean, do, whatever makes you happy. There's at least 3 of these flying around in various stages of abandonment. Here's one: https://github.com/vektra/mockery https://github.com/vektra/mockery
- pstuart 9y agoLooks like there's an official tool: https://github.com/golang/mock https://github.com/golang/mock
- piinbinary 9y agoDo any of those build this style of mock? I looked around a while back and didn't come across one. edit: I looked again and found https://github.com/matryer/moq https://github.com/matryer/moq which seems similar