]> Cypherpunks repositories - gostls13.git/commitdiff
go/version: use "custom" as an example of a version suffix
authorDmitri Shuralyov <dmitshur@golang.org>
Fri, 14 Nov 2025 20:40:43 +0000 (15:40 -0500)
committerDmitri Shuralyov <dmitshur@golang.org>
Thu, 20 Nov 2025 16:02:33 +0000 (08:02 -0800)
The suffix in a non-standard toolchain version can be any string. Show
more of a middle ground example of a non-standard version suffix,
aligning it with the example used at https://go.dev/doc/toolchain#name.

For #75953.

Change-Id: I98f9c4de98316aecf76c017eb13cf25582c8939c
Reviewed-on: https://go-review.googlesource.com/c/go/+/720621
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/go/version/version.go

index 6b8ee6744239d5d9d7c8a167a69c0250dfb70459..cfd2e9ba36f1670f041e014c8fa2cec4b1d8e68b 100644 (file)
@@ -4,7 +4,7 @@
 
 // Package version provides operations on [Go versions]
 // in [Go toolchain name syntax]: strings like
-// "go1.20", "go1.21.0", "go1.22rc2", and "go1.23.4-bigcorp".
+// "go1.20", "go1.21.0", "go1.22rc2", and "go1.23.4-custom".
 //
 // [Go versions]: https://go.dev/doc/toolchain#version
 // [Go toolchain name syntax]: https://go.dev/doc/toolchain#name
@@ -15,10 +15,10 @@ import (
        "strings"
 )
 
-// stripGo converts from a "go1.21-bigcorp" version to a "1.21" version.
+// stripGo converts from a "go1.21-custom" version to a "1.21" version.
 // If v does not start with "go", stripGo returns the empty string (a known invalid version).
 func stripGo(v string) string {
-       v, _, _ = strings.Cut(v, "-") // strip -bigcorp suffix.
+       v, _, _ = strings.Cut(v, "-") // strip -custom suffix.
        if len(v) < 2 || v[:2] != "go" {
                return ""
        }