forgejo-mcp/main.go
Christoph Görn c80dbfd55a
fix: 🐛 show module version when installed via go install
Fall back to runtime/debug.BuildInfo when ldflags version is not set,
so `go install` users see the actual module version instead of "dev".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 09:42:33 +01:00

18 lines
311 B
Go

package main
import (
"runtime/debug"
"codeberg.org/goern/forgejo-mcp/v2/cmd"
)
var Version = "dev"
func main() {
if Version == "dev" {
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "" && info.Main.Version != "(devel)" {
Version = info.Main.Version
}
}
cmd.Execute(Version)
}