Commit 5946e461 authored by Russ Cox's avatar Russ Cox

goinstall: fix build

func init runs *after* var declarations

TBR=niemeyer
CC=golang-dev
https://golang.org/cl/4260055
parent 4371e094
......@@ -11,17 +11,22 @@ import (
var (
thisOS = runtime.GOOS
thisArch = runtime.GOARCH
otherOS = "freebsd"
otherArch = "arm"
otherOS = anotherOS()
otherArch = anotherArch()
)
func init() {
if thisOS == otherOS {
otherOS = "linux"
func anotherOS() string {
if thisOS != "darwin" {
return "darwin"
}
if thisArch == otherArch {
otherArch = "amd64"
return "linux"
}
func anotherArch() string {
if thisArch != "amd64" {
return "amd64"
}
return "386"
}
type GoodFileTest struct {
......
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