This is a created article in which the information may have evolved or changed.
1, download platform related Golang file, because the interior wall of Golang official website, only use the Golang to provide the download method
2, TAR-ZXVF go1.6.2.linux-amd64.tar.gz-c/usr/local
3, Vi/etc/profile
Add the following (the Red Word section is add content):
#/etc/profile:system-wide. profile file for the Bourne shell (SH (1))
# and Bourne compatible shells (Bash (1), Ksh (1), Ash (1), ...).
If ["' Id-u '"-eq 0]; Then
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"
Else
Path= "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin"
Fi
Export PATH
export gopath= $HOME/gowork
4, Source/etc/profile
5. Use user Login to execute the following command:
mkdir $GOAPTH
Create the Gopath directory, and the Gowork directory should appear in the system directory when you are finished creating it.