mirror of
https://github.com/lukaszraczylo/go-telegram.git
synced 2026-07-11 06:23:19 +00:00
feat(telemetry): switch to SendForModule, drop hand-bumped Version
Replaces the hand-bumped client.Version="0.7.11" with telemetry.SendForModule which reads the actual module version from runtime/debug.BuildInfo.Deps at the consumer's build time. This means future releases (v0.7.12, v0.8.0, …) will be reported by the running bot WITHOUT requiring a manual edit of client/version.go on every tag — consumers just `go get -u` and rebuild. client.Version is preserved as a fallback for replace directives / detached `go run`, and remains overridable via -ldflags. Bumps oss-telemetry to v0.2.1.
This commit is contained in:
+7
-8
@@ -1,12 +1,11 @@
|
||||
package client
|
||||
|
||||
// Version is the released version of the go-telegram library. Keep in sync
|
||||
// with the most recent git tag; this constant is bumped manually on each
|
||||
// release. Exposed as a var (not const) so downstream applications may
|
||||
// override it via linker flags:
|
||||
// Version is a fallback version string used only when Go's build info is
|
||||
// unavailable (replace directives, detached `go run`) or has been overridden
|
||||
// via linker flags. The authoritative version forwarded to telemetry is
|
||||
// resolved at runtime by [telemetry.SendForModule] from the build info of
|
||||
// whatever binary linked this library, so this constant does NOT need to be
|
||||
// bumped on every release. Exposed as a var (not const) for ldflag override:
|
||||
//
|
||||
// go build -ldflags="-X github.com/lukaszraczylo/go-telegram/client.Version=1.2.3"
|
||||
//
|
||||
// The value is also forwarded as the version field of the anonymous usage
|
||||
// ping that fires on the first call to New (see fireTelemetryOnce).
|
||||
var Version = "0.7.11"
|
||||
var Version = "0.0.0-fallback"
|
||||
|
||||
Reference in New Issue
Block a user