Gitaly's golangci-lint plugin fails to identify `TestMain` function
Gitaly's golangci-lint plugin has a rule to ensure each test package contains a TestMain
function. It doesn't correctly identify a test (_test
suffix) package has a TestMain
if it is located in the base package (non _test
) and the test package doesn't import the base package. This leads to false positives on missing TestMain
. This is because the linter searches for the base package in the _test
packages imports. If the _test
package doesn't import the base package, the linter will not find the TestMain
function.
For example, a blank import is needed here to workaround this even if there already is a TestMain
here.