$GOOS $GOARCH
darwin 386
darwin amd64
dragonfly 386
dragonfly amd64
freebsd 386
freebsd amd64
freebsd arm
linux 386
linux amd64
linux arm
netbsd 386
netbsd amd64
netbsd arm
openbsd 386
openbsd amd64
plan9 386
plan9 amd64
solaris amd64
windows 386
windows amd64
Setting up the toolchain
The hard way
Get the source code
git clone https://go.googlesource.com/go
cd go/
git checkout go1.4.2
cd src/
$ ls ../bin/
darwin_amd64 linux_arm windows_386 go gofmt
Sample Go App
packagemainimport (
"fmt""os/user")
funcmain() {
// Get Current User
currentUser, err:=user.Current()
iferr!=nil {
fmt.Println("Error: "+err.Error())
}
fmt.Println("My home dir is: "+currentUser.HomeDir)
}
Building the app
go build sampleApp.go
GOOS="windows" GOARCH="386" ./go/bin/go build sampleApp.go