]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] cmd/go: refuse to build Go 1.22 code
authorRuss Cox <rsc@golang.org>
Fri, 11 Aug 2023 14:58:26 +0000 (10:58 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 11 Aug 2023 17:11:34 +0000 (17:11 +0000)
commit201f8b40dceb7a821fd9958b2061c33d436d107b
tree4d4eba26dc55d729c75fd63b416bfca872993d3a
parentadb775e309dea43157e931835e920ac9e7769abe
[release-branch.go1.20] cmd/go: refuse to build Go 1.22 code

With #60078 accepted, we expect Go 1.22 will have different
for loop semantics than Go 1.20 did. Once Go 1.22 is released,
Go 1.20 will be unsupported, but add a check anyway, just to
help catch some mistakes and usage of old Go toolchains
beyond their end-of-support.

Note that Go 1.20 can keep being used indefinitely with pre-Go 1.22 code.
This change only makes it refuse to build code that says it needs
Go 1.22 semantics, because Go 1.20 does not provide those.

For #60078.

Change-Id: I75118d6fbd0cc08a6bc309aca54c389a255ba7dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/518675
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/internal/work/exec.go
src/cmd/go/testdata/script/build_go122.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_go_version.txt