Skip to content
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: use go.mod to define the required version of Go #26499

Closed
Kanshiroron opened this issue Jul 20, 2018 · 7 comments
Closed

cmd/go: use go.mod to define the required version of Go #26499

Kanshiroron opened this issue Jul 20, 2018 · 7 comments
Labels
FeatureRequest FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@Kanshiroron
Copy link

Hello,

Looking at the modules features introduced in GoLang 1.11 (proposal), I think we are missing the ability to fix the minimum GoLang version for the module.

Best regards,

@mvdan
Copy link
Member

mvdan commented Jul 20, 2018

You mean let modules specify the minimum Go version required to build them? Or perhaps to run them too?

Would this be just a major version like 1.9, or a full version like 1.9.2?

@mvdan mvdan changed the title [Modules] Use go.mod to fix minimum GoLang version cmd/go: use go.mod to define the required version of Go Jul 20, 2018
@mvdan mvdan added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. modules labels Jul 20, 2018
@mvdan
Copy link
Member

mvdan commented Jul 20, 2018

Also note that this is somewhat possible with build tags already, such as // +build go1.9. You can make it so that a package doesn't build with older versions, or even that it only builds with a particular major versison of Go like 1.10. This is what GopherJS does: https://github.com/gopherjs/gopherjs/blob/master/compiler/version_check.go

@Kanshiroron
Copy link
Author

Kanshiroron commented Jul 20, 2018

Hello @mvdan
I can't really tell the difference between the two (build and run) as to me you don't need Go to run compiled software. I think it would be a good idea to be able to fix a full version just in case the project needs a fix that has been implemented in a minor release.

@Kanshiroron
Copy link
Author

That's right it would actually be the same as // +build go1.9 but managed at the module level, so it's easier to manage.

@adelowo
Copy link

adelowo commented Jul 20, 2018

Wouldn't this lead to something like a version manager ? (ala ruby version manager ) 👎

@bcmills bcmills added this to the Go1.12 milestone Jul 20, 2018
@rajender
Copy link
Contributor

Looks like this is duplicate of #23969.

@mvdan
Copy link
Member

mvdan commented Jul 20, 2018

You're right @rajender, thanks for noticing.

@mvdan mvdan closed this as completed Jul 20, 2018
@golang golang locked and limited conversation to collaborators Jul 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

6 participants