x/tools/go/analysis/analysistest: adding a test file to test-data package breaks RunWithSuggestedFixes #40574
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Suppose you run
analysistest.Run
on a package with a test file (say to test test-specific behavior of the analyzer). What apparently happens is that analysistest calls the analyzer once on the package without its tests, and once on the package with its tests. This is not a big deal; you get some duplicate error messages.But now suppose you instead run
analysistest.RunWithSuggestedFixes
. In this case, analysistest ends up combining the fixes from both runs. This means you get all your fixes applied twice, which surely doesn't match your.golden
file! it's a very confusing error.A workaround is to change the test file to
mypackage_test
, such that the two runs will be entirely disjoint.The text was updated successfully, but these errors were encountered: