mirror of
https://github.com/golang/go
synced 2024-11-19 22:04:44 -07:00
goinstall: fix build
func init runs *after* var declarations TBR=niemeyer CC=golang-dev https://golang.org/cl/4260055
This commit is contained in:
parent
4371e09457
commit
5946e46138
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user