You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Formatting differences are expected based on the work in https://github.com/golang/go/commits/master/src/runtime/debug/mod.go, but no longer producing the Main field is a breaking change. I've verified that no fields are set as well, and that this is not just formatting, by specifically printing buildInfo.Main.Path from the code above (which is empty).
The text was updated successfully, but these errors were encountered:
@michaelmatloob@seankhliao I'm rather surprised by this otherwise undocumented change in behaviour, I would expect at least some mention of this in the release notes. @ianlancetaylor can we amend the notes to help other folks from tripping over this change? Could you also please confirm that my understanding below is correct? I am not sure I fully understand the consequences of this change.
For future readers who stumble upon this: It looks like as part of the workspaces feature, some runtime/debug.BuildInfo details for the pseudo-package command-line-arguments, which represents file arguments passed to go commands, were removed. Using a package path (relative or otherwise) instead of file arguments (such as path/to/main.go) avoids the command-line-arguments package, and produces consistent results across versions. For example, changing the original example above from
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://pkg.go.dev/runtime/debug#ReadBuildInfo no longer sets the
Main
field on https://pkg.go.dev/runtime/debug#BuildInfo. We usedebug.ReadBuildInfo
to make it so that code from https://github.com/bufbuild/buf/tree/main/private can only be imported by projects in github.com/bufbuild - our version of "organization-private". We do this via https://github.com/bufbuild/buf/blob/main/private/usage/usage.go. See bufbuild/homebrew-buf#8What did you expect to see?
A value for the
Main.Path
field offoo
.In 1.17.8 this is:
What did you see instead?
In 1.18 this is:
Formatting differences are expected based on the work in https://github.com/golang/go/commits/master/src/runtime/debug/mod.go, but no longer producing the
Main
field is a breaking change. I've verified that no fields are set as well, and that this is not just formatting, by specifically printingbuildInfo.Main.Path
from the code above (which is empty).The text was updated successfully, but these errors were encountered: