1.下载golang安装包

wget https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz

2.解压至/usr/local文件夹

tar -C /usr/local -xzf go1.12.5.linux-amd64.tar.gz

2.配置环境变量vim /etc/profile

export GOROOT=/usr/local/go #设置为go安装的路径
export GOPATH=$HOME/go #默认安装包的路径
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

source /etc/profile使修改生效.

3.测试结果

centos7安装golang环境

 创建文件夹

mkdir -p /root/go/src

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2021-11-07
  • 2022-01-28
  • 2021-12-11
  • 2021-07-05
  • 2021-08-11
猜你喜欢
  • 2021-06-26
  • 2022-01-06
  • 2022-12-23
  • 2022-01-01
  • 2022-01-24
相关资源
相似解决方案