Closed remyleone closed 1 year ago
Very strange:
--- FAIL: TestAnalyzerFixes (1.19s)
Error: analysistest.go:229: /home/runner/work/tfproviderlint/tfproviderlint/xpasses/XR007/testdata/src/a/alias.go: error formatting resulting source: 9:6: expected '(', found fAlias (and 1 more errors)
package a
import (
e "os/exec"
)
var failingAlias = // want "avoid os/exec.Command"
func fAlias() {
// want "avoid os/exec.Command"
failingAlias("true")
}
package a
import (
e "os/exec"
)
var failingAlias = e.Command // want "avoid os/exec.Command"
func fAlias() {
e.Command("true") // want "avoid os/exec.Command"
failingAlias("true")
}
Maybe switching those files to this syntax will fix them as a quick fix for whatever is going on differently in x/tools:
var (
// ...
)
If it helps any, I bisected those test failures down to golang.org/x/tools v0.1.8. Using v0.1.7, they pass just fine. Interestingly, and maybe related, it's v0.1.8 that fixes the original issue this was intended to fix, namely #255 which I happen to be hitting trying to run make providerlint
on the AWS provider.
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.
@remyleone can you ensure that all the files from
go mod vendor
are added as well? Thanks!