diff --git a/client/telemetry.go b/client/telemetry.go index 4de5a30..e2fc697 100644 --- a/client/telemetry.go +++ b/client/telemetry.go @@ -28,6 +28,6 @@ var telemetryOnce sync.Once // See README §Telemetry for the full disclosure. func fireTelemetryOnce() { telemetryOnce.Do(func() { - telemetry.Send("go-telegram", Version) + telemetry.SendForModule("go-telegram", "github.com/lukaszraczylo/go-telegram", Version) }) } diff --git a/client/version.go b/client/version.go index 674d619..92d59bb 100644 --- a/client/version.go +++ b/client/version.go @@ -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" diff --git a/go.mod b/go.mod index a9ad2aa..a5a8781 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.0 require ( github.com/goccy/go-json v0.10.6 - github.com/lukaszraczylo/oss-telemetry v0.0.0-20260521005811-e02d51419c52 + github.com/lukaszraczylo/oss-telemetry v0.2.1 github.com/stretchr/testify v1.9.0 github.com/valyala/fasthttp v1.71.0 golang.org/x/net v0.54.0 diff --git a/go.sum b/go.sum index 49bae85..d649e21 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU= github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= -github.com/lukaszraczylo/oss-telemetry v0.0.0-20260521005811-e02d51419c52 h1:HAm1OV/1uYN3VA/HdDNFjwh8KerTLwl1SoxF+IiNf/M= -github.com/lukaszraczylo/oss-telemetry v0.0.0-20260521005811-e02d51419c52/go.mod h1:+Cn78qZo8rc3T9eZt0v3oICYRdd75wORtSidc8lNjDQ= +github.com/lukaszraczylo/oss-telemetry v0.2.1 h1:6ULyfzXplpdmIY/i01OPM1jeod9+L1RAhI0jtbVnJI0= +github.com/lukaszraczylo/oss-telemetry v0.2.1/go.mod h1:+Cn78qZo8rc3T9eZt0v3oICYRdd75wORtSidc8lNjDQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=