Files

21 lines
676 B
Go
Raw Permalink Normal View History

2026-09-18 12:03:35 +02:00
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
// The volumen release identity.
package version
import "runtime/debug"
// Version reports the release the toolchain recorded for this build: the
// tag when the checkout is at one, a pseudo-version naming the commit
// otherwise, and (devel) outside version control. Nothing writes a version
// number, so the recorded value cannot go stale, and a dirty tree reports
// +dirty honestly.
func Version() string {
bi, ok := debug.ReadBuildInfo()
if !ok || bi.Main.Version == "" {
return "(devel)"
}
return bi.Main.Version
}