Go language is an open source, grammatically simplified static programming language. Its open source community is relatively large and its application scenarios are very wide. It can be used for system monitoring, container technology (Docker), big data, storage technology, distributed system (Hyperledger Fabric), messaging system (Kafka client), server management, security tools, web tools, etc.
Here is an introduction to installing and configuring go on Linux.
1. Download the go installation package
Go to GoLang China and download the Go language installation package.
Unzip the installation package
tar -C /usr/local -xzf go1.15.6.linux-amd64.tar.gz
2. Create a new folder gocode in /usr/local
cd /usr/local
mkdir gocode
3. Modify the /etc/profile configuration file
su root
vim /etc/profile
## 添加如下路径:
export GOROOT=/usr/local/go
export GOPATH=/usr/local/gocode
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
4. Make the configuration file effective
source /etc/profile