This is a created article in which the information may have evolved or changed.
First of all, please allow me to say dirty words: fuck you, GFW.
It's a hassle to install Golang now, because of Google's tragedy, we can't go from Golang's official website down to the source code. And my Ubuntu is installed through Apt-get to the 1.0.2 version, when compiling an open source project, it will be reported sync.pool undefined. Although it is possible to download the X86 version of the Open source project, my ultimate goal is to run it on arm, so I need to compile from the source code.
1. Find source code
Golang.org not to go, borrow colleagues of foreign agents get go1.3.1.src.tar.gz, decompression, compile, resolute continue tragedy! Looking at the problem, there is a Python script in the access code.google.com ... , they say Google does not go, but also visit a hair.
2. Find binary
Intermittent agent on golang.org, found that there is a binary to provide download, with the agent next X86, more than 40 MB, agent performance is too poor, down ... According to the file name Bing a bit, found that there is a website to download, yes! address: http://fossies.org/linux/misc/go1.3.1.linux-386.tar.gz. The source code is also available on the website, but the binary package also includes the source code, and the next is enough.
3. Compiling
Although there is a binary, but the arm environment is still not, need to compile a bit.
Set Goroot:export Goroot=/usr/local/go
Set Path:export path= $PATH: $GOROOT/bin
Compiling arm:cgo_enabled=0 goarch=arm goos=linux./make.bash
After success, run the Go tool and you can see 5g and 5l.
Get a hellow world,cgo_enabled=0 goarch=arm go build hello.go, you can compile an executable file that runs on arm.