Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Restore mocked variables in GoLang unit test

One of the guarding principles of writing unit test is that there should be no real external calls for dependant services. Unit test should run by its own and can run without issues on any environment including local, build, test environment. This indicates there should be some mock responses whenever an external call is needed so that different unit test scenarios can be covered.How can this be done in GoLang? In GoLang, anything can be assigned to a variable even including functions. A variable can be created to reference a function and it can be called just like a normal function when neede...

6,289 0       UNIT TEST GOLANG MOCK FUNCTION RESTORE MOCK