DEV Community

Discussion on: My 2 Cents On Go

Collapse
 
quii profile image
Chris James

To mock functions declare them as variables

Do you mean having them as global variables? If so, please dont do this.

Use dependency injection for explicit documentation of what your code is using and where.

Collapse
 
idoshamun profile image
Ido Shamun

For a small scale service I find it cumbersome but you are right DI is the better way