This is a creation in Article, where the information may have evolved or changed.
Guide
The Go language, also known as Golang, is an open-source programming language originally developed by Google, which is designed to follow the 3 principles of simplicity, security, and speed. The go language has a variety of debugging, testing, analysis, and code review tools, and now the go language and tools are available in the source library of most Linux distributions, and I'll show you how to install the Go language for Linux.
Installation
First look at whether CentOS is 64-bit or 32-bit, which shows that 64 is 64 bits:
getconf LONG_BIT
Then download the go-linux-64-bit source package, manual wget installation, not recommended Yum installation (now the latest version is 1.8, the latest version of the Yum Warehouse is only 1.4).
wget http://www.golangtc.com/static/go/1.8/go1.8.linux-amd64.tar.gz
Unzip the binaries to the/usr/local directory
sudo tar -xzf go1.8.linux-amd64.tar.gz -C /usr/local
Use VI to add the following in the environment variable configuration file/etc/profile:
vi /etc/profile 或者 vi $HOME/.profile
Add in:
# GO PATHexport PATH=$PATH:/usr/local/go/bin# GO GOPATHexport GOPATH=/home/golang
Make the profile configuration effective immediately:
source $HOME/.profile
View go version or environment variables
go version #查看go版本
go env #查看go环境变量
Complete. You can see the Gopath directory as /home/golang/.