Package Usage: go: github.com/maratori/testpackage
testpackage is golang linter that makes you use a separate `_test` package.
According to blackbox testing approach, you should not use unexported functions and methods from source code in tests.
Go allows to place tests in a separate package with suffix `_test`.
For example, tests for `store` package can be in the same package or in the package `store_test`.
In the second case, you have to import the source code into tests so only exported things are available.
The linter reports if a test is in a package without suffix `_test`.
If you really need to test unexported function, then put the test into file `XXX_internal_test.go`.
The linter skips such files by default.
It also skips the file `export_test.go` by default (see the last article below).
More detailed articles on this topic:
4 versions
Latest release: about 2 years ago
904 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/maratori/testpackage