mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 08:23:50 +01:00
32 lines
672 B
Go
32 lines
672 B
Go
package version
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
var (
|
|
zreplVersion string // set by build infrastructure
|
|
)
|
|
|
|
type ZreplVersionInformation struct {
|
|
Version string
|
|
RuntimeGOOS string
|
|
RuntimeGOARCH string
|
|
RUNTIMECompiler string
|
|
}
|
|
|
|
func NewZreplVersionInformation() *ZreplVersionInformation {
|
|
return &ZreplVersionInformation{
|
|
Version: zreplVersion,
|
|
RuntimeGOOS: runtime.GOOS,
|
|
RuntimeGOARCH: runtime.GOARCH,
|
|
RUNTIMECompiler: runtime.Compiler,
|
|
}
|
|
}
|
|
|
|
func (i *ZreplVersionInformation) String() string {
|
|
return fmt.Sprintf("zrepl version=%s GOOS=%s GOARCH=%s Compiler=%s",
|
|
i.Version, i.RuntimeGOOS, i.RuntimeGOARCH, i.RUNTIMECompiler)
|
|
}
|