]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] go/version: fix package to accept go1.21.0-bigcorp
authorRuss Cox <rsc@golang.org>
Wed, 24 Jan 2024 21:29:20 +0000 (16:29 -0500)
committerMichael Knyszek <mknyszek@google.com>
Thu, 1 Feb 2024 18:32:47 +0000 (18:32 +0000)
commit7b3786bbb16f1bcd9e740f05627bf965f8a5a54d
treeab3f832ef7bbc67e1cc4b6fa00eab1e86c846041
parent9289b9c3369de4fbcd8cc3bf365d532c6d79b867
[release-branch.go1.22] go/version: fix package to accept go1.21.0-bigcorp

The proposal discussion made clear that suffixes should be accepted,
so that people who use custom VERSION files can still pass runtime.Version()
to this code. But we forgot to do that in the CL. Do that.

Note that cmd/go also strips space- and tab-prefixed suffixes,
but go.dev/doc/toolchain only mentions dash, so this code only
strips dash.

Fixes #65061.

Change-Id: I6a427b78f964eb41c024890dae30223beaef13eb
Cq-Include-Trybots: luci.golang.try:go1.22-linux-amd64-longtest,go1.22-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/559796
TryBot-Bypass: Russ Cox <rsc@golang.org>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/559802
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/go/version/version.go
src/go/version/version_test.go