-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
Go version
go version go1.25rc2 darwin/arm64
Output of go env
in your module/workspace:
(not relevant)
What did you do?
I noticed a regression in a particular edge case of the -buildvcs
behavior.
Consider the following minimal sequence that reproduces it:
$ cd $(mktemp -d)
$ mkdir subdir
$ (cd subdir && go mod init example.com/subdir && go get [email protected])
$ echo 'package main; import ("fmt"; "log"; "runtime/debug"); func main() { bi, ok := debug.ReadBuildInfo(); if !ok { log.Fatalln("no build info") }; fmt.Println(bi.Main.Version) }' > subdir/main.go
$ git init && git add . && git commit -m 'example commit'
$ cd subdir
$ GOTOOLCHAIN=go1.24.5 go run -buildvcs=true .
v0.0.0-20250726003140-f31775ad565e
$ GOTOOLCHAIN=go1.25rc2 go run -buildvcs=true .
(devel)
What did you see happen?
As visible above, when using Go 1.25 the reported main module version is "(devel)" despite -buildvcs=true and the example.com/subdir module being inside a git repository.
What did you expect to see?
As visible above, when using Go 1.24 the reported main module version is "v0.0.0-20250726003140-f31775ad565e". I expected Go 1.25 to report the same version.
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.