Steve Thielemann пре 1 година
родитељ
комит
ae8b77fa54
2 измењених фајлова са 13 додато и 5 уклоњено
  1. 3 2
      testdoor/testdoor.go
  2. 10 3
      testdoor/version.go

+ 3 - 2
testdoor/testdoor.go

@@ -248,10 +248,11 @@ func display_information(d *door.Door) {
 	header = "Build:    "
 	offset = strings.Repeat(" ", len(header))
 	d.Write(headerColor + header)
-	gover, gitver := GetVersion()
+	gover, gitver, goarch, goos := GetVersion()
 	d.Write(nice_format("go version", gover))
 	d.Write(offset + nice_format("git commit", gitver))
-
+	d.Write(offset + nice_format("Arch", goarch))
+	d.Write(offset + nice_format("OS", goos))
 	for mod, version := range modules {
 		d.Write(offset + nice_format(mod, version))
 	}

+ 10 - 3
testdoor/version.go

@@ -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 ok bool
 	var results string
+	var garch, gos string
 	buildinfo, ok = debug.ReadBuildInfo()
 	if ok {
 		// We have build info, display it.
@@ -36,10 +37,16 @@ func GetVersion() (string, string) {
 			if bs.Key == "vcs.revision" || bs.Key == "vcs.time" {
 				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 {