version

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package version exposes build identity for the binary.

The release workflow stamps Version via -ldflags:

go build -ldflags="-X github.com/mmedum/pipedrive-mcp/internal/version.Version=v1.2.3" ...

VCS metadata (commit SHA, build time, dirty flag) is read from runtime/debug.BuildInfo. Go's default -buildvcs=auto populates these for any module-rooted build, so they're free.

Note: we deliberately do NOT use BuildInfo.Main.Version for the tag — that field is "(devel)" for `go build` and only populates correctly under `go install module@version` (golang/go#29228). Tags must come from the linker.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is set at build time. Default "dev" for local builds.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Version   string // tag (from -ldflags) or "dev"
	Commit    string // VCS revision; empty if unavailable
	Time      string // build time in RFC3339; empty if unavailable
	Dirty     bool   // true if VCS reported uncommitted changes
	GoVersion string
}

BuildInfo bundles the human-readable identity of the running binary.

func Info

func Info() BuildInfo

Info returns the current build identity. debug.ReadBuildInfo is already runtime-cached; no further caching needed.

func (BuildInfo) String

func (b BuildInfo) String() string

String renders Info as a single line suitable for `--version` output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL