-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
testing: 'go test' broken in go1.13 #34443
Comments
Please search the issue tracker before opening a new one #31859 Or read the release notes:
|
Sorry, I missed the release note, and I did search the tracker 😞 |
Never the less, this is a terrible regression |
terrible |
@gbbr the reason we considered this an acceptable change is that calling flags.Parse in an init was always arguably incorrect. There might be other packages that have not yet registered their flags at that point. I suggest you modify your code to avoid calling flags.Parse inside init. |
@cespare I definitely don't disagree with that. I guess I should've been more specific to say that what I meant by "terrible" was the fact that the output given by the |
With
go1.13
thego test
command broke due to the fix for #21051.Consider the following program made of two files:
file.go
:file_test.go
:Building the test binary fails to attach the test flags, resulting in an error of the type:
Consider the output of the below command with
go1.13
:versus
go1.12
, which display the entire list of flags.The issue is present because at the time the
main
package parses the flags, test flags are not yet attached.The text was updated successfully, but these errors were encountered: