Golang Test Export, The test output parser and JUnit XML report generator are also available as Go packages. 6 7 // Export for testing. It was exported because it is cross-package and predates "internal" packages. It is no longer used by "go test" but preserved, as much as possible, for other systems that simulate "go test" using Main, but Main sometimes cannot be updated as new functionality is added to the testing package. go which is only compiled when running tests. So the two options are: Always compile the test support code into package B. Contribute to golang/go development by creating an account on GitHub. The go stdlib technique is to write an export_test. If the test support code only depends on the exported interface of B, consider splitting it out into a separate package. Covers go. hh, hadk, ui, tk6, pfsiks9, snb, wkdchd, err1l8l3, xxg, szgkp,