-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
format go-list do not marshal #2
Conversation
Currently the exec.Cmd that is run contains formatting instructions for -json and -f, in >go1.17 this just works, as -json takes precidence. This has becomes an error in go1.17, so we should pick one and just use that. My preferences is to have go-list do the parsing, use -f, and just chomp the string before passing it to ioutil.ReadFile.
Could you revert the change on the go.mod? thank you |
I would be happy to, but per the spec, the go directive is supposed to indicate the version a module was written with, and these changes are for the go1.17 toolchain, tested against it, and generated with it. |
But this works for go <1.17, and it's not a go1.17 specific feature, the behavior doesn't change between go1.16 and go1.17. The intention behind the sentence
In fact the only require change is to remove
|
I fixed the problem in bedb342 |
I cannot find the reference, but usually see the go directive used to mean "the maximum version supported by the module". |
When you create a module, the Then it's weird to indicate a maximum version because it's not useful information, in some points of view it can be seen as false information because it's impossible to say that your code works with all the previous versions of Go. For me, everybody uses the The specification seems clear to me:
|
I agree that people frequently try and use it to define a minimal version, since it can be used as a gate that "affects use of new language features" thereby enforcing some notion of backwards compatibility. However, it "was originally intended to support backward incompatible changes to the Go language", and this only works if you use it to mean I support version up to I thought there was an issue about this, but we should really pin down what the version means: min, max, or something else. |
There is a ticket: golang/go#30791; thre does not seem to be any consensus. |
Currently the exec.Cmd that is run contains formatting instructions for
-json and -f, in >go1.17 this just works, as -json takes precidence.
This has becomes an error in go1.17, so we should pick one and just use
that. My preferences is to have go-list do the parsing, use -f, and just
chomp the string before passing it to ioutil.ReadFile.