3 ms·
Dont forgot that the java mocking you are proposing requires JMockit, which in turn requires Reflection, and requires you to understand how JMockIt actually wor
by TeeWEE 12y ago
Dont forgot that the java mocking you are proposing requires JMockit, which in turn requires Reflection, and requires you to understand how JMockIt actually works... There is a lot of bookkeeping.
In the go example, its just pure core go language, nothing more is needed todo the mocking. In my opinion the go example is a lot simpler than the java example that requires a big mocking framework.
Not to forget, that in go, you can implement interfaces around a simple type such as a int, yes a simple int can implement a whole interface. And there is no explicit bookkeeping needed
- MetaCosm 12y agoThere are also partial mocking libraries for Go. http://blog.getsocialize.com/2013/getting-a-handle-on-testing-and-mocking-in-golang http://blog.getsocialize.com/2013/getting-a-handle-on-testin...