I have seen several different test package naming strategies within Go and wanted to know what pros and cons of each are and which one I should use.
Strategy
One important notes I'd like to add about import . from Golang CodeReviewComments:
The import . form can be useful in tests that, due to circular dependencies,
cannot be made part of the package being tested:
package foo_test
import (
"bar/testutil" // also imports "foo"
. "foo"
)
In this case, the test file cannot be in package foo because it uses
bar/testutil, which imports foo. So we use the 'import .' form to let the file
pretend to be part of package foo even though it is not.
Except for this one case, do not use import . in your programs.
It makes the programs much harder to read because it is unclear whether a name
like Quux is a top-level identifier in the current package or in an imported package.