version

package
v0.19.0 Latest Latest
Warning

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

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

README

internal/version

Overview

Reports the openstorage build version as one line. It combines linker-stamped package variables with Go module build info from runtime/debug.

Interface

  • String — returns openstorage <version> (commit <rev>, built <time>, <go version>) [version.go:String]
  • Unexported version, commit, date — set by release -ldflags -X; defaults "devel", "", "" [version.go:version]

Invariants

  • version is replaced by bi.Main.Version only while it is still "devel" and the module version is non-empty and not "(devel)" [version.go:String]
  • commit and date come from the vcs.revision and vcs.time build settings only when the linker left them empty, so linker values win [version.go:String]
  • Empty commit or built details are omitted; the Go runtime version is always appended [version.go:String]

Side Effects

  • Calls debug.ReadBuildInfo() and runtime.Version() [version.go:String]

Verification

  • Run: go test ./internal/version/... -tags=openstorage_viewcheck -count=1 -race -timeout=30m

Documentation

Overview

Package version reports the build version of the openstorage binary.

Release builds stamp the package variables below via -ldflags -X (see scripts/release-archives.sh and .github/workflows/release.yml). Unstamped builds (plain `go build`, `go install module@version`) fall back to Go module build info where available.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String() string

String returns a single-line human-readable description like

openstorage v0.1.0 (commit 4594422de478…, built 2026-08-23T00:00:00Z, go1.26.0)

omitting the commit/built fields when neither the linker nor the build info supplies them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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