Files
semver-generator/main.go
T
lukaszraczylo 888415366a feat(telemetry): switch to SendForModule for auto-version resolution
Replace telemetry.Send(name, PKG_VERSION) with telemetry.SendForModule
so the binary reports its release version automatically from
runtime/debug.BuildInfo whenever PKG_VERSION isn't injected (e.g.
`go install` without ldflags). The goreleaser path still wins because
goreleaser's -X main.PKG_VERSION={{.Version}} populates the fallback,
but `go install github.com/lukaszraczylo/semver-generator@vX.Y.Z`
users now also get the correct version without ldflag plumbing.

Bumps oss-telemetry to v0.2.1.
2026-05-22 23:34:58 +01:00

36 lines
952 B
Go

/*
Copyright © 2021 LUKASZ RACZYLO <lukasz$raczylo,com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"time"
telemetry "github.com/lukaszraczylo/oss-telemetry"
"github.com/lukaszraczylo/semver-generator/cmd"
)
var (
PKG_VERSION string
)
func main() {
telemetry.SendForModule("semver-generator", "github.com/lukaszraczylo/semver-generator", PKG_VERSION)
defer telemetry.Wait(2 * time.Second)
cmd.PKG_VERSION = PKG_VERSION
cmd.Execute()
}