I have a package pkg
. The test for package pkg
are in _test.go files. However to initialize a test runner I need a a function from other package which I can't import in pkg
because of circular dependecy.
My idea is to use pkg_test
package.
Is there any way to access test functions (in _test.go files) from pkg
in pkg_test
?
My project structure:
├── f.go # package pkg
├── f_test.go # package pkg
├── init_test.go # package pkg_test
In other words: I want to access a function from f_test.go in init_test.go or vice versa (access a function from init_test.go in f_test.go. Is there any way to do it?
PS: in f_test.go I can't import pkg_test