forked from cerc-io/laconicd-deprecated
more fixes
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
AppVersion = ""
|
||||
GitCommit = ""
|
||||
BuildDate = ""
|
||||
|
||||
GoVersion = ""
|
||||
GoArch = ""
|
||||
)
|
||||
|
||||
func init() {
|
||||
if len(AppVersion) == 0 {
|
||||
AppVersion = "dev"
|
||||
}
|
||||
|
||||
GoVersion = runtime.Version()
|
||||
GoArch = runtime.GOARCH
|
||||
}
|
||||
|
||||
func Version() string {
|
||||
return fmt.Sprintf(
|
||||
"Version %s (%s)\nCompiled at %s using Go %s (%s)",
|
||||
AppVersion,
|
||||
GitCommit,
|
||||
BuildDate,
|
||||
GoVersion,
|
||||
GoArch,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user