Discover Packages
github.com/coder/openstorage
internal
version
package
Version:
v0.19.0
Opens a new window with list of versions in this module.
Published: Oct 30, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
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
Expand ▾
Collapse ▴
Documentation
¶
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.
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.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.