But the mocking frameworks you link too are impressive feats of coding to work around quirks in Java. They only make it look easy because someone else did the heavy lifting for you.
--
Mocking is not trivial in Go.Say if you have an interface that has 100 functions. In your unit test, you must manually define 100 methods for the mocked object in order to fulfill the interface's requirement.
And it is impossible to mock constructors and static methods.
This is something that you have to be willing to give up when working with Go. :'(I think most Go adopters don't come from a TTD background, and don't have an appreciation for a good mocking library...As for me, I'm debating if I should overlook the lack of mocking support since I don't want to sacrifice the easy of testability(code quality) for performance gain.If you want a static typed language with good concurrent support and TDD friendly. Checkout Scala, and see how easy it is to write unit test that mocks stuffs: http://www.scalatest.org/user_guide/testing_with_mock_objects
Is it actually necessary to have one big Client interface for Redis? You may be able to split it up in to interfaces that have subsets of the complete functionality. That could simplify the creation of implementations that only need to handle a few operations.