1.下载go(最新版列表 https://studygolang.com/dl)

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

 

2.解压go到 /opt/

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

 

3.增加环境变量,编辑 /etc/profile 增加如下三行

export PATH=$PATH:/opt/go/bin
export GOROOT=/opt/go
export GOPATH=/root/project #项目代码所在目录,建议编译之前手动建立一个 /root/project

 

4.刷新环境变量

source /etc/profile

 

5.产看版本

go version

 

6.安装gcc编译器(根据要要编译的项目可选)

yum install gcc

 

相关文章:

  • 2021-04-05
  • 2021-08-10
  • 2021-11-04
  • 2021-07-11
  • 2022-02-19
  • 2022-02-24
  • 2022-12-23
  • 2021-05-31
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2021-04-22
  • 2021-11-15
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案