sentry-go
sentry-go copied to clipboard
Get release information from the runtime (Go 1.18)
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
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.