I also changed broken tests to use variable assignation instead of variable declaration.
Using variable declaration in tests will fails as the code output will fail with gofmt and analysistest.RunWithSuggestedFixes expect edited code to be able to run under gofmt.
Old test would do
var failingAlias = e.Command // want "avoid os/exec.Command"
to
var failingAlias = // want "avoid os/exec.Command"
This will also fail with the bulk version
var (
failingAlias = // want "avoid os/exec.Command"
)
If you prefer i could change XR007 and XR008 to edit assignments and variables declaration containing the selectionExpr.
It would work like this
var (
failingAlias = e.Command // want "avoid os/exec.Command"
)
After some rigamarole with needing to upgrade Go (#269) and then x/tools (#270), this should be resolved in the upcoming v0.29.0 release 🔜 . Thanks for submitting this and sorry for the delayed resolution.
I updated golang.org/x/tools to v0.2.0
I also changed broken tests to use variable assignation instead of variable declaration. Using variable declaration in tests will fails as the code output will fail with gofmt and
analysistest.RunWithSuggestedFixes
expect edited code to be able to run under gofmt.Old test would do
to
This will also fail with the bulk version
If you prefer i could change XR007 and XR008 to edit assignments and variables declaration containing the selectionExpr. It would work like this
to