All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m27s
Test / Hakurei (push) Successful in 3m15s
Test / Hpkg (push) Successful in 4m11s
Test / Sandbox (race detector) (push) Successful in 4m18s
Test / Hakurei (race detector) (push) Successful in 5m2s
Test / Flake checks (push) Successful in 1m30s
This is cleaner and makes more sense. The longer LDFLAGS was never a valid concern since it is always inserted by a script. Signed-off-by: Ophestra <cat@gensokyo.uk>
20 lines
518 B
Go
20 lines
518 B
Go
package info
|
|
|
|
// FallbackVersion is returned when a version string was not set by the linker.
|
|
const FallbackVersion = "dirty"
|
|
|
|
// buildVersion is the Hakurei tree's version string at build time.
|
|
//
|
|
// This is set by the linker.
|
|
var buildVersion string
|
|
|
|
// Version returns the Hakurei tree's version string.
|
|
// It is either the value of the constant [FallbackVersion] or,
|
|
// when possible, a release tag like "v1.0.0".
|
|
func Version() string {
|
|
if buildVersion != "" {
|
|
return buildVersion
|
|
}
|
|
return FallbackVersion
|
|
}
|