Mocks and other code meant specifically for testing should not be compiled into binaries or production code. However, adding helper functions to _test.go files means it cannot be used in other packages which leads to either code duplication or compiling the code all the time. It also runs the risk of production code coming to depend on "test" code without realizing it
We should come up with some system (build tags, make rules, or something else) to ensure this sort of code is only available for testing
Mocks and other code meant specifically for testing should not be compiled into binaries or production code. However, adding helper functions to
_test.go
files means it cannot be used in other packages which leads to either code duplication or compiling the code all the time. It also runs the risk of production code coming to depend on "test" code without realizing itWe should come up with some system (build tags, make rules, or something else) to ensure this sort of code is only available for testing