1
0
mirror of https://github.com/golang/go synced 2024-11-26 10:48:22 -07:00

cmd/dist: sort gohostos switch entries

Sort gohostos switch entries for readability/maintainability.

Change-Id: I565b0aee33e8463502faa68eaceea6f7dccca66b
Reviewed-on: https://go-review.googlesource.com/c/go/+/154379
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
Joel Sing 2018-12-16 03:14:40 +11:00 committed by Tobias Klauser
parent 916e861fd9
commit 991c85a750

16
src/cmd/dist/main.go vendored
View File

@ -56,6 +56,9 @@ func main() {
gohostos = runtime.GOOS
switch gohostos {
case "aix":
// uname -m doesn't work under AIX
gohostarch = "ppc64"
case "darwin":
// Even on 64-bit platform, darwin uname -m prints i386.
// We don't support any of the OS X versions that run on 32-bit-only hardware anymore.
@ -72,6 +75,11 @@ func main() {
if runtime.GOARCH == "arm" {
defaultclang = true
}
case "plan9":
gohostarch = os.Getenv("objtype")
if gohostarch == "" {
fatalf("$objtype is unset")
}
case "solaris":
// Even on 64-bit platform, solaris uname -m prints i86pc.
out := run("", CheckExit, "isainfo", "-n")
@ -81,16 +89,8 @@ func main() {
if strings.Contains(out, "i386") {
gohostarch = "386"
}
case "plan9":
gohostarch = os.Getenv("objtype")
if gohostarch == "" {
fatalf("$objtype is unset")
}
case "windows":
exe = ".exe"
case "aix":
// uname -m doesn't work under AIX
gohostarch = "ppc64"
}
sysinit()