Go compiler environment installed Centos

1. Download go (the latest version of the list https://studygolang.com/dl)

wget -c https://studygolang.com/dl/golang/go1.13.5.linux-amd64.tar.gz

 

2. Extract go to / opt /

tar -C /opt/ -zxvf go1.13.5.linux-amd64.tar.gz

 

3. Increase environmental variables, edit / etc / profile add the following three lines

the PATH the PATH = $ Export: / opt / Go / bin 
Export GOROOT = / opt / Go 
Export GOPATH = / root / project # project code directory, before compiling recommendations to manually create a / root / project

 

4. Refresh environment variable

source /etc/profile

 

The production version look

go version

 

6. Install the gcc compiler (optional to be compiled according to the project)

yum install gcc

 

Guess you like

Origin www.cnblogs.com/radmin/p/12146317.html