Open timstclair opened 8 years ago
The most common reason for this structure is to avoid import cycles,
Hmm, I thought external tests were done to make it easier to test exported APIs of packages (i.e., you can be confident that an external package doesn't accidentally rely on some private unexported functionality). I didn't realize it had much to do with import cycles.
Tests can have a different package from the package they're testing, such as with the stdlib package
http / http_test
(not to be confused withhttptest
). The most common reason for this structure is to avoid import cycles,Currently we include both
TestImpors
andXTestImports
whenIncludeTests
is set, which can cause the godepq dependency graph to have cycles. Cycles in the graph are problematic for functions like DepthLast.