]> Cypherpunks repositories - gostls13.git/commitdiff
gotest: use build.ArchChar()
authorRobert Hencke <robert.hencke@gmail.com>
Sat, 10 Dec 2011 22:42:29 +0000 (14:42 -0800)
committerRob Pike <r@golang.org>
Sat, 10 Dec 2011 22:42:29 +0000 (14:42 -0800)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5480060

src/cmd/gotest/gotest.go

index 2e8e20ccf0b47ea816b5f538825b14b60a4cfd4e..7b90bbd6ab0e5280092b0654965b2837eefc9822 100644 (file)
@@ -114,13 +114,6 @@ func Fatalf(s string, args ...interface{}) {
        os.Exit(2)
 }
 
-// theChar is the map from architecture to object character.
-var theChar = map[string]string{
-       "arm":   "5",
-       "amd64": "6",
-       "386":   "8",
-}
-
 // addEnv adds a name=value pair to the environment passed to subcommands.
 // If the item is already in the environment, addEnv replaces the value.
 func addEnv(name, value string) {
@@ -143,9 +136,10 @@ func setEnvironment() {
                GOARCH = runtime.GOARCH
        }
        addEnv("GOARCH", GOARCH)
-       O = theChar[GOARCH]
-       if O == "" {
-               Fatalf("unknown architecture %s", GOARCH)
+       var err error
+       O, err = build.ArchChar(GOARCH)
+       if err != nil {
+               Fatalf("unknown architecture: %s", err)
        }
 
        // Commands and their flags.