ubuntu18.04安装go环境

1.下载Go语言安装包 官网:下载地址
2. 获取安装包

wget https://studygolang.com/dl/golang/go1.13.4.linux-amd64.tar.gz # 解压文件 tar xfz go1.13.4.linux-amd64.tar.gz -C /usr/local

3. 配置全局变量
#修改~/.bashrc vim ~/.bashrc #添加Gopath路径 export GOPATH=/usr/local/go export PATH=$GOPATH/bin:$PATH

激活配置
source ~/.bashrc

4.验证是否配置成功
go version #提示warning warning: GOPATH set to GOROOT (/usr/local/go) has no effect go version go1.13.4 linux/amd64

5.全局变量修改
vim ~/.bashrc#变量修改为一下配置 export GOROOT=/usr/local/go export GOPATH=$PATH:$GOROOT/bin

6.验证
go version go version go1.13.4 linux/amd64

【ubuntu18.04安装go环境】原文:ubuntu18.04安装go环境

    推荐阅读