-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/go/analysis/analysistest: output and golden file differ, but RunWithSuggestedFixes does not report failure #47118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently in two locations in
Calling I can submit a change if there's agreement on the fix. |
cc @matloob |
Skipping on An alternative fix is to return an error whenever |
Thank you for looking into this issue.
To clarify, by "return an error", did you mean "call t.Errorf"?
I think it's worth keeping this option open for the future. In this case, I don't think we should fail the test if Instead we should call |
Not quite what I had in mind. But your suggestion makes more sense in context. Here is roughly my understanding of this:
Here is roughly my understanding of this:
I think both make sense. I am really interested if we know why we chose to skip reporting an error historically. |
Looking at the CL it seems like not reporting an error was an oversight. I can't think of a good reason to just ignore that case |
https://golang.org/cl/351552/ has fixed this issue by calling |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
See a minimal example at https://github.com/nishanths/analysistest-fmt-issue, along with an explanation in the README.
I originally discovered the issue doing the following:
What did you expect to see?
I would have expected
analysistest.RunWithSuggestedFixes
to report a failure.What did you see instead?
The test passed.
The text was updated successfully, but these errors were encountered: