Files
go-telegram/client/version.go
T
lukaszraczylo 609c4ce649 feat: anonymous adoption telemetry on first client.New
Sends one fire-and-forget POST per process the first time a consumer
constructs a Bot via client.New. Helps track real-world adoption and
version spread of the library. No identifiers, no API contents.

Implementation:
- new client/version.go: exported Version var (currently 0.7.11)
- new client/telemetry.go: sync.Once gate + telemetry.Send call
- client.go New(): single fireTelemetryOnce() line at function entry
- client/telemetry_test.go: TestMain disables outgoing pings during the
  library's own test suite

README §Telemetry documents the payload, the opt-out env vars, and links
to the upstream oss-telemetry source so consumers can audit what is sent.

Opt out via any of:
  DO_NOT_TRACK=1
  OSS_TELEMETRY_DISABLED=1
  GO_TELEGRAM_DISABLE_TELEMETRY=1
  osstelemetry.Disable() before the first client.New
2026-05-21 03:59:07 +01:00

13 lines
528 B
Go

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:
//
// 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"