x/tools/go/analysis/analysistest: problem with Requires and structtag.Analyzer #52973
Labels
Analysis
Issues related to static analysis (vet, x/tools/go/analysis)
FrozenDueToAge
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes, I also tested in a docker instance with 1.18.2
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I worked on a branch available here
https://github.com/ccoVeille/tagliatelle/blob/golang-issue/
I'm trying to use an analyzer that requires on
structtag.Analyzer
to be validatedhttps://github.com/ccoVeille/tagliatelle/blob/golang-issue/tagliatelle.go
I'm launching the code via go test -v ./...
I added this to the tests
https://github.com/ccoVeille/tagliatelle/blob/golang-issue/testdata/src/a/sample.go#L43-L52=
It's a struct that is not compatible with
reflect.StructTag
, I added to my testdata file, because I want to be able to detect such issueI expect the
Requires
code to stop the code and execution, but also to print the errors.I checked the
structtag.Analyzer
is launch and report the issue, the issues are reported, so appended to a.diagnosishttps://cs.opensource.google/go/x/tools/+/master:go/analysis/internal/checker/checker.go;l=684?q=ImportObjectFact&ss=go%2Fx%2Ftools
But then, they are not available.
I tried to edit the golang code locally, but failed to find a solution, I think it's a bug.
I also checked I'm using the latest version go tools
https://github.com/ccoVeille/tagliatelle/blob/golang-issue/go.mod#L7=
What did you expect to see?
I'm expecting the code to print the error returned by the
structtag.Analyzer
What did you see instead?
The text was updated successfully, but these errors were encountered: