This is a creation in Article, where the information may have evolved or changed.
1. Create the source directory of the Go language and the target directory of the executing program
mkdir ~/go
mkdir ~/gobin
2. Add the environment variables required for the Go language
Export goroot= $HOME/go
Export goarch=386
Export Goos=linux
Export gobin= $HOME/gobin
Export path= $PATH: $GOBIN
Exit the shell and log back in to re-import the environment variable
3. Install the required toolkit for compiling
Apt-get Install Python-setuptools Python-dev
sudo apt-get install mercurial
sudo apt-get install bison gcc Libc6-dev ed
4. Get the Go Language source package
HG Clone–r release https://go.googlecode.com/hg/$GOROOT
5. Compiling the Go Language pack
CD $GOROOT/SRC
./all.bash
6. HelloWorld
Filename:HelloWorld.go
Package Main
Import "FMT"
Func Main () {
Fmt. Printf ("Hello, GO language.../n")
}
6.1 Compilation: 8g Helloworld.go
6.2 Link: 8l Helloworld.8
6.3 Execution:./8.out
Ok