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 ( ...@@ -11,17 +11,22 @@ import (
var ( var (
thisOS = runtime.GOOS thisOS = runtime.GOOS
thisArch = runtime.GOARCH thisArch = runtime.GOARCH
otherOS = "freebsd" otherOS = anotherOS()
otherArch = "arm" otherArch = anotherArch()
) )
func init() { func anotherOS() string {
if thisOS == otherOS { if thisOS != "darwin" {
otherOS = "linux" return "darwin"
} }
if thisArch == otherArch { return "linux"
otherArch = "amd64" }
func anotherArch() string {
if thisArch != "amd64" {
return "amd64"
} }
return "386"
} }
type GoodFileTest struct { 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