github.com/Bayer-Group/mocka/v2 (go): Package mocka is a simple mocking and stubbing library for the Go programming language. It is used to assist with writing unit tests around third-party functions.  There are times when you would want to control the output of a third-party function in testing. Sometimes making an wrapper around that package/function is more than what you are wanting to do. Mocka is here to solve that problem. It allows you to control the output of functions without needing to write any additional code.  Currently if you would want to control the output of a function in go it would be akin to  This structure increases the length of unit tests; depending on how many functions are needing to control. Mocka provides a safe way to stub functions while also reducing the amount of code required.  Mocka does this safely using reflection, no calls to the unsafe package are made.  The mocka way would be
Keywords: golang|golang-package|mocking|stubbing|testing