include goversion used to compile mox in the mox version

This commit is contained in:
Mechiel Lukkien
2024-11-28 16:28:05 +01:00
parent 636bb91df6
commit d7f057709f
10 changed files with 19 additions and 15 deletions

View File

@ -2,16 +2,24 @@
package moxvar
import (
"runtime"
"runtime/debug"
)
// Version is set at runtime based on the Go module used to build.
var Version = "(devel)"
var Version string
// VersionBare does not add a "+modifications" or other suffix to the version.
var VersionBare = "(devel)"
// VersionBare does not add a "+modifications", goversion or other suffix to the version.
var VersionBare string
func init() {
Version = "(devel)"
VersionBare = "(devel)"
defer func() {
Version += "-" + runtime.Version()
}()
buildInfo, ok := debug.ReadBuildInfo()
if !ok {
return