Not everybody in the Go community favours the use of mocking tools, so many 
published solutions don't have any tests of that kind.   Maybe you should 
write the tests yourself.

I use pegomock for mocking.  (I tried gomock but I found issues that were 
not fixed.  I also found a couple of issues with pegomock too, but the 
author fixed them.)

Pegomock tool is a fairly conventional mocking tool.  Given an interface, 
it produces a concrete class that implements the interface and can be told 
at runtime how to respond to a method call.  So anything you test has to be 
defined by an interface.  Of course, if you only have a concrete class, Go 
allows you to create your own interface that matches it, so that's not a 
big problem.

If you want some worked examples of pegomock, see my 
scaffolder https://github.com/goblimey/scaffolder.  It generates a web 
server with pegomock tests for some of the components.

Regards

Simon  

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to