This is a creation in Article, where the information may have evolved or changed.
VI ~/. bashrc# Append the following environment variable at the end of the file #export goroot= $HOME/go#export goarch=386#export GOOS =linux#export GOBIN= $HOME/binhg# prompt Invalid command Let's execute the command below to get HGsudoinstall -R Release https:///go.googlecode.com/hg/$GOROOTcd $GOROOT/src. /all.bash
But Ubuntu seems to support installation directly: sudo apt-get install golang-go
~/.BASHRC is the current login user's environment variable profile, after successful installation, seemingly and online description of the compilation methods are different, I do not know is not the reason for the rapid change go? Compile commands from the legendary 6g into go
mkdir ~/~/srcvi hello.go# input source go hello.gols. /hello
The following is the famous Hello program in the Go language version: Hello.go
Package Main
Import "FMT"
Func Main () {
Fmt. Printf ("hello,world\n")
}