]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.15] cmd/go: error out of 'go mod tidy' if the go version is newer...
authorBryan C. Mills <bcmills@google.com>
Thu, 13 May 2021 13:48:40 +0000 (09:48 -0400)
committerCarlos Amedee <carlos@golang.org>
Wed, 2 Jun 2021 19:01:28 +0000 (19:01 +0000)
commitfbf844b46d147c442a6016aa9c6bef51c309257b
treec12e0c83b9dea30c1b5ceb1a4db3a4acbc0a4f03
parentd9cffabed288ebece50ece29d44eff283e5cc485
[release-branch.go1.15] cmd/go: error out of 'go mod tidy' if the go version is newer than supported

This backports the test from CL 319669, but — because of extensive
changes to the module loader during the Go 1.16 and 1.17 cycles — the
implementation is entirely different. (This implementation is based on
the addGoStmt function already present in init.go.)

Fixes #46143
Updates #46142

Change-Id: Ib7a0a159e53cbe476be6aa9a050add10cc750dec
Reviewed-on: https://go-review.googlesource.com/c/go/+/319710
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/go/internal/modcmd/tidy.go
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/mod_tidy_too_new.txt [new file with mode: 0644]