-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: test doesn't compile examples unless an output is provided #16773
Comments
This looks like a regression that is probably worth fixing in a 1.7.x. The testing package still says that it will run and verify example code, and only that the example may include the expected output. |
@rakyl commented that they're not being compiled at all though, which is a regression |
I cannot reproduce it. I am on 1.7 stable and I have just checked making one of examples, without an output section, invalid (
|
I cannot produce this problem anymore. I was able to produce both against tip and go1.7. There was something sketchy about my env a week ago. I have little idea how it affected the example tests but am going to close this issue to avoid more noise. |
go test
doesn't compile and report compilation errors if the example doesn't have an output section. This used to be different in the past and we were able to use examples to provide usage snippets without worrying that they are broken.The current requirement to have an output section is impractical in complex examples such as:
where go test is trying to run the block and fails because it cannot find the downloaded-client-secret.json. Since we are only caring about the integrity of the examples and not willing to verify them, please give us an option to build examples without output assertion.
The text was updated successfully, but these errors were encountered: