I am working with Golang and using mockhiato to generate mocks for all interfaces. This tool generates mocked implementation in mocks.go file within the same package. I can't rename mocks.go to mocks_test.go as this mock file is consumed by other packages.
The problem is that these mocks files are counted by go coverage tool and thus reducing my code coverage percentage for the package.
I am looking a good workaround so that my code coverage will not show bad numbers.
That's how we solved it.
Used mockery to generate mocks.
Generate mocks in a separate _mock folder.
The best thing in this case would be to move the mocks to their own dedicated package which would have no test coverage. This would remove their impact on code that you actually want coverage data on.