]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: be less strict about go version syntax in dependency go.mod files
authorRuss Cox <rsc@golang.org>
Thu, 6 May 2021 18:01:20 +0000 (14:01 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 13 May 2021 15:33:24 +0000 (15:33 +0000)
commitcde2d857fe1f13ade269e3f7d58c6c2379a53c50
tree93ae8b9d97e274b6d8293aa3111228b4425fce06
parent2a61b3c59088115245d084d5ae07dd4be5fbe1b0
cmd/go: be less strict about go version syntax in dependency go.mod files

It is unclear what the future holds for the go line in go.mod files.
Perhaps at some point we will switch to semver numbering.
Perhaps at some point we will allow specifying minor versions
or even betas and release candidates.
Those kinds of changes are difficult today because the go line
is parsed in dependency modules, meaning that older
versions of the Go toolchain need to understand newer go lines.

This CL makes that case - parsing a go line in a dependency's
go.mod file - a bit more lax about how to find the version.
It allows a leading v and any trailing non-digit-prefixed string
after the MAJOR.MINOR section.

There are no concrete plans to make use of any of these changes,
but if in the future we want to make them, having a few Go releases
under out belt that will accept the syntax in dependencies will
make any changes significantly easier.

Change-Id: I79bb84bba4b769048ac4b14d5c275eb9a3f270c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/317690
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go.mod
src/cmd/go.sum
src/cmd/go/testdata/script/badgo.txt [new file with mode: 0644]
src/cmd/vendor/golang.org/x/mod/modfile/rule.go
src/cmd/vendor/modules.txt