Re:Back to basics: Writing an application using Go and Postg...
by jamesrr39 on Tuesday November 23, 2021 @05:27AM
(#29316295)
For testing I wrote 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!
[ Parent
| on HN ]
Re:Back to basics: Writing an application using Go and Postg...
by jrockway on Tuesday November 23, 2021 @06:17AM
(#29316538)
Quite 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! ;)