3 ms·
For testing I wrote https://github.com/jamesrr39/go-mockgen-tool https://github.com/jamesrr39/go-mockgen-tool to generate mock implementations of a given interf
by jamesrr39 5y ago
For testing I wrote https://github.com/jamesrr39/go-mockgen-tool https://github.com/jamesrr39/go-mockgen-tool to generate mock implementations of a given interface. It's a different approach from the normal reflect and interface{}... heavy libraries. Might be interesting!
- pqb 5y agoLooks interesting! Reminds me impl[0], which comes bundled with `vscode-golang`. [0]: https://github.com/josharian/impl https://github.com/josharian/impl
- jrockway 5y agoQuite reasonable! I think if you keep your interfaces small, you might not need it, but if you do have a couple of beefy interfaces, then this is a lot more pleasant than using a dedicated mock framework. A function is a great way to mock a function -- you can do anything! ;)