golang安装ubuntu

# 下载
wget https://studygolang.com/dl/golang/go1.15.2.linux-amd64.tar.gz
# 解压
tar -C /usr/local -xzf go1.15.2.linux-amd64.tar.gz
# 添加路径
vim ~/.bashrc

export GOROOT=/usr/local/go
export GOPATH=/home/yeyangfengqi/workspace
export GOBIN=$GOPATH/bin
export PATH=$GOPATH:$GOBIN:$GOROOT:$PATH::/usr/local/go/bin
export GOPROXY=https://goproxy.cn,direct

# 更新环境
source ~/.bashrc
# 验证
go env

你可能感兴趣的:(golang安装ubuntu)