Centos7安装go1.13环境

1.下载go

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

2.解压

  • tar -C /usr/local -zxvf go1.13.linux-amd64.tar.gz

3.设置环境变量

  • sudo vi ~/.profile

添加

PATH=”$HOME/bin:$HOME/.local/bin:$PATH”
export PATH=$PATH:/usr/local/go/bin 
export GOROOT=/usr/local/go 
export GOPATH=$HOME/go 
export PATH=$PATH:$HOME/go/bin

重载

  • source ~/.profile

4.创建go的家目录、查看版本

[root@localhost opt]# echo $HOME/root
[root@localhost opt]# mkdir /root/go[root@localhost opt]# go versiongo version go1.13 linux/amd64

 


评论 (6)

  • Kathryn Diederich Reply

    Apr 20 2022 01:04 am
  • Ranker SEO Reply

    Feb 26 2022 05:28 pm
  • Shelton Shipman Reply

    Feb 24 2022 08:22 pm
  • Lauren Dykes Reply

    Feb 19 2022 09:16 pm
  • Benedict Prather Reply

    Feb 16 2022 01:17 pm
  • Perry Kearney Reply

    Feb 14 2022 11:38 am

发表评论

上一篇: Go 1.13版本介绍 下一篇: Go go.mod入门