This is a creation in Article, where the information may have evolved or changed.
(from Baidu Experience)
Golang is a development language
This time we're going to install the Golang environment under Linux.
Let's introduce how to configure the Golang environment on Linux
Tools/Materials
- A Linux server that can surf the internet
- A Windows computer
Method/Step
- 1
Please install the SSH remote Tool yourself
- 2
SSH telnet to your Linux server
- 3
Yum Install mercurial
Installing the Mercurial Package
- 4
Installing a git package
Yum Install git
- 5
Installing GCC
Yum Install GCC
- 6
And then you can download Golang's Zip package.
wget https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz
- 7
Download complete
- 8
Unzip the package with the TAR command
TAR-ZXVF go1.2.linux-amd64.tar.gz
- 9
And then we're going to add environment variables
Vi/etc/profile
- 10
Add the following content to the profile
Export Goroot=/home/forward/tools/go
Export path= $GOROOT/bin: $PATH
Export gopath=/home/forward/tools/gopkg
Gopath and Goroot change to your path.
- 11
Then we refresh the environment variable
Source/etc/profile
- 12
Finally we verify that the installation is successful
Go version
If the following message appears stating that the installation was successful