The framepointer analysis pass was checked into x/tools at CL 248686. We need to vendor that into the stdlib so it can be used by vet.
Not sure how to make this work. I do
$ cd GOROOT/src/cmd
$ go get -d golang.org/x/tools@latest
$ go mod tidy
$ go mod vendor
It succeeds, but the framepointer package doesn't appear. Only the ifaceassert package gets updated. So it is doing something, but not what I need it to do.
It also looks like the previous import was done on 2020/11/10, which is after the framepointer analysis pass was checked in (which was 11/2). So it didn't make it in then either.
Anyone understand what is going on?
@dmitshur
My understanding is that go mod vendor only brings in required packages, and cmd/vet/main.go does not import golang.org/x/tools/go/analysis/passes/framepointer.
There are 28 subdirectories of src/cmd/vendor/golang.org/x/tools/go/analysis/passes, but 44 subdirectories in https://godoc.org/golang.org/x/tools/go/analysis/passes.
Ah, so I need to import a nonexistent package first, and then run the vendor tool.
I think so. And you probably need to pass framepointer.Analyzer to unitchecker.Main.
Ok, thanks, making progress now.
Change https://golang.org/cl/276372 mentions this issue: cmd/vet: vendor in x/tools, enable framepointer vet check
Change https://golang.org/cl/276373 mentions this issue: doc: add description of new framepointer vet check
Most helpful comment
My understanding is that
go mod vendoronly brings in required packages, and cmd/vet/main.go does not importgolang.org/x/tools/go/analysis/passes/framepointer.