After installing Go 1.3 on my windows 7 machine (amd64), a strange effect occurs after cross compiling to linux, both with the msi-installer and the zip file. The same happens with Go version 1.2.2. Here is what I am doing:
After a fresh installation, everything is as expected:
C:\go\src> go version
go version go1.3 windows/amd64
Then I set the environment variables to linux:
C:\go\src> $env:GOOS="linux"
C:\go\src> $env:GOARCH="amd64" (setting GOARCH or not had no effect)
Then I (re-)compile with:
C:\go\src> .\make.bat
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool.
lib9
...
The result is:
Installed Go for linux/amd64 in C:\go
Installed commands in C:\go\bin
Then the output of go version is:
go version go1.3 windows/386
and the binaries in C:\go\bin are 32-bit.
If I try to get back my amd64-installation with...
C:\go\src> $env:GOARCH="amd64"
C:\go\src> $env:GOOS="windows"
C:\go\src> .\make.bat
the amd64 binaries are in C:\go\bin\windows_amd64 and in C:\go\bin there are the 32-bit versions. The go version is still go1.3 windows/386.
I tried several things, but in every case my installation ends up as windows/386. Can anybody tell me what I'm doing wrong? I never had this problem with prior installations of Go and I don't know what I might have done differently.
Michael