Skip to content

Commit eb55b98

Browse files
dmitshurgopherbot
authored andcommitted
cmd/dist: add "devel" substring check to isRelease computation
Non-release versions that are built from source without a VERSION file specifying any particular version end up with a development version like "devel go1.25-67e0681aef Thu Apr 24 12:17:27 2025 -0700". Right now those versions are correctly determined to be non-release because they don't have a "go" prefix, instead they have a "devel " prefix. In preparation of being able to move the "devel" substring, add a check that said substring isn't present anywhere, since it is certain not to be included in any released Go version we publish at https://go.dev/dl/. For #73372. Change-Id: Ia3e0d03b5723d4034d6270c3a2224f8dfae380e9 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/667955 Auto-Submit: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 3f3782f commit eb55b98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/dist/build.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ func xinit() {
274274
tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
275275

276276
goversion := findgoversion()
277-
isRelease = strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")
277+
isRelease = (strings.HasPrefix(goversion, "release.") || strings.HasPrefix(goversion, "go")) &&
278+
!strings.Contains(goversion, "devel")
278279
}
279280

280281
// compilerEnv returns a map from "goos/goarch" to the

0 commit comments

Comments
 (0)