Proposal Details

// go.mod        
module test

go 1.20
// main.go
package main

import (
    "fmt"
    "go/types"
)

func main() {
    fmt.Println(types.Unalias(nil))
}
$ go version
go version go1.22.2 darwin/arm64

$ go run main.go
<nil>

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)?

Comment From: seankhliao

Duplicate of #46136