sentry-go icon indicating copy to clipboard operation
sentry-go copied to clipboard

Get release information from the runtime (Go 1.18)

Open rhcarvalho opened this issue 4 years ago • 1 comments

Starting with Go 1.18, the go command embeds information about the build which can be retrieved using runtime/debug.ReadBuildInfo for the current binary.

We can use that information to provide a possibly better automatic release detection functionality and to augment the metadata sent along with events.

References:

  • https://tip.golang.org/doc/go1.18#go-command
  • https://tip.golang.org/doc/go1.18#debug/buildinfo

rhcarvalho avatar Dec 22 '21 14:12 rhcarvalho

See https://github.com/carlmjohnson/versioninfo for a sample project that parses build info on Go 1.18 without breaking in old versions of Go.

earthboundkid avatar Jan 04 '22 15:01 earthboundkid