Commit d8d32106 authored by Robert Hencke's avatar Robert Hencke Committed by Rob Pike

gotest: use build.ArchChar()

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5480060
parent fdb09d28
...@@ -114,13 +114,6 @@ func Fatalf(s string, args ...interface{}) { ...@@ -114,13 +114,6 @@ func Fatalf(s string, args ...interface{}) {
os.Exit(2) 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. // addEnv adds a name=value pair to the environment passed to subcommands.
// If the item is already in the environment, addEnv replaces the value. // If the item is already in the environment, addEnv replaces the value.
func addEnv(name, value string) { func addEnv(name, value string) {
...@@ -143,9 +136,10 @@ func setEnvironment() { ...@@ -143,9 +136,10 @@ func setEnvironment() {
GOARCH = runtime.GOARCH GOARCH = runtime.GOARCH
} }
addEnv("GOARCH", GOARCH) addEnv("GOARCH", GOARCH)
O = theChar[GOARCH] var err error
if O == "" { O, err = build.ArchChar(GOARCH)
Fatalf("unknown architecture %s", GOARCH) if err != nil {
Fatalf("unknown architecture: %s", err)
} }
// Commands and their flags. // Commands and their flags.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment