|
@@ -22,10 +22,11 @@ func ShowVersion() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-func GetVersion() (string, string) {
|
|
|
|
|
|
+func GetVersion() (goversion string, gitcommit string, arch string, goos string) {
|
|
var buildinfo *debug.BuildInfo
|
|
var buildinfo *debug.BuildInfo
|
|
var ok bool
|
|
var ok bool
|
|
var results string
|
|
var results string
|
|
|
|
+ var garch, gos string
|
|
buildinfo, ok = debug.ReadBuildInfo()
|
|
buildinfo, ok = debug.ReadBuildInfo()
|
|
if ok {
|
|
if ok {
|
|
// We have build info, display it.
|
|
// We have build info, display it.
|
|
@@ -36,10 +37,16 @@ func GetVersion() (string, string) {
|
|
if bs.Key == "vcs.revision" || bs.Key == "vcs.time" {
|
|
if bs.Key == "vcs.revision" || bs.Key == "vcs.time" {
|
|
results += bs.Value + " "
|
|
results += bs.Value + " "
|
|
}
|
|
}
|
|
|
|
+ if bs.Key == "GOARCH" {
|
|
|
|
+ garch = bs.Value
|
|
|
|
+ }
|
|
|
|
+ if bs.Key == "GOOS" {
|
|
|
|
+ gos = bs.Value
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return goversion, results
|
|
|
|
|
|
+ return goversion, results, garch, gos
|
|
}
|
|
}
|
|
- return "", ""
|
|
|
|
|
|
+ return "", "", "", ""
|
|
}
|
|
}
|
|
|
|
|
|
func GetModules() map[string]string {
|
|
func GetModules() map[string]string {
|