VI ~ /. Bashrc # append the following environment variable to the end of the file # export goroot= $ Home/Go # export goarch=386# Export GOOS=Linux # export Gobin= $ Home/Binhg # An invalid command is prompted so that the following command can obtain HgSudoApt-GetInstallMercurialhg clone-R release https://Go.googlecode.com/hg/ $ gorootCD $ goroot/SRC./All. Bash
However, UBUNTU seems to support installation: sudo apt-Get install golang-go
~ /. Bashrc is the environment variable configuration file of the currently logged-on user. After the installation is successful, it seems to be different from the compilation method described on the Internet. I don't know why go is changing rapidly? The compilation command changes from the legendary 6 GB to go
Mkdir~ /Srccd~ /Srcvi hello. Go # Input Source Code go hello. GoLs./Hello
Below is the famous helloProgramGo language version: Hello. Go
Package main
Import "FMT"
Func main (){
FMT. printf ("Hello, world \ n ")
}