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

proposal: cmd/go: warn if module uses features from next version of Go #67907

Antonboom opened this issue Jun 8, 2024 · 1 comment


Copy link

Proposal Details

// go.mod        
module test

go 1.20
// main.go
package main

import (

func main() {
$ go version
go version go1.22.2 darwin/arm64

$ go run main.go

But! types.Unalias was appeared in Go 1.22.

And any other module >= Go 1.20 can use module above as dependency (according to new policy) but will receive compiler error like

main.go:9: undefined: types.Unalias

How can a developer check the version of your module to ensure that it does not contain features from the new toolchain (which may be installed as the latest version on the developer's machine)?

Copy link

Duplicate of #46136

@seankhliao seankhliao marked this as a duplicate of #46136 Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants