version

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package version reports the build version of pgoverlay's binaries (pgb, branchd, pgoverlay-github).

Release builds stamp the variables with the linker, for example:

go build -ldflags "-X github.com/abd-ulbasit/pgoverlay/internal/version.Version=v1.0.0
  -X github.com/abd-ulbasit/pgoverlay/internal/version.Commit=1a2b3c4
  -X github.com/abd-ulbasit/pgoverlay/internal/version.Date=2026-09-28T10:00:00Z"

`make build` fills them in from `git describe`. Unstamped builds fall back to the binary's embedded build info: `go install …/cmd/pgb@v1.0.0` reports v1.0.0, and a plain `go build` inside a checkout reports "dev" plus the VCS revision.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = ""
	Date    = ""
)

Set with -ldflags "-X …". Version stays "dev" for local builds.

Functions

func String

func String() string

String renders the build identity on one line, for example "v1.0.0 (commit 1a2b3c4, built 2026-09-28T10:00:00Z, go1.26.5 linux/amd64)". Unknown parts are left out.

Types

type Info

type Info struct {
	Version   string // "v1.0.0", or "dev" for an unstamped local build
	Commit    string // VCS revision (at most 12 characters), "" when unknown
	Date      string // build or commit time (RFC 3339), "" when unknown
	Modified  bool   // built from a checkout with uncommitted changes
	GoVersion string // e.g. go1.26.5
	Platform  string // GOOS/GOARCH
}

Info is the resolved build identity: the ldflags values, completed from the embedded build info where they were left unset.

func Get

func Get() Info

Get resolves the build identity.

func (Info) String

func (i Info) String() string

Jump to

Keyboard shortcuts

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