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

Comments

Projects
None yet
5 participants
@Kanshiroron
Copy link

commented Jul 20, 2018

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

commented Jul 20, 2018

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Jul 20, 2018

Looks like this is duplicate of #23969.

@mvdan

This comment has been minimized.

Copy link
Member

commented Jul 20, 2018

You're right @rajender, thanks for noticing.

@mvdan mvdan closed this Jul 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.