On 2012/11/1 Sebastian Es <
seba...@hypenode.com> wrote:
> Hello,
>
> I want to test unexported methods in package. According to Go source tests
> are grouped in <package_name>_test package so unexported functions are
> invisible here. The only way to do this is putting them in the same package.
> How to bite this?
Most package put tests in the same package as code (but in *_test.go
files). Using the packagename_test package is only necessary when you
have circular imports problems, which is not very common.
So just use "package <packagename>" in your test files unless it
causes a problem. The tests will be able to access all private
identifiers.
Rémy.