This is a created article in which the information may have evolved or changed.
Linux Platform Environment setup:
- Download Go language binary archive package: https://golang.org/dl/
- Unzip the archive package to the/usr/local directory, or you can put it in another directory:
tar -zxf go1.7.4.linux-amd64.tar.gz -C /usr/local
- Verify the installation results: Enter the go directory with the terminal:
bin/go version
If the version information for the go language is displayed, it will succeed.
Configure environment variables: Modify/ETC/PROFILE (environment variable takes effect for all users) or $home/.profile (for single user)
Goroot:go Language installation directory (used when directory is not in/usr/local)
GOBIN: directory where executable files are stored
Gopath:go language Workspace (contains src, pkg, bin three directories), can have multiple
Bin directory for Path:go language installation directory: Export path= $PATH:/usr/local/go
- Verify: Enter go version in any file directory, if the Go language version information is successful.