golang linux安装

golang在linux的二进制安装:

1. wget "https://studygolang.com/dl/golang/go1.17.7.linux-amd64.tar.gz"

2. tar -zxvf ~/soft/go1.17.7.linux-amd64.tar.gz -C /usr/local/src
  ln -s /usr/local/src/go/bin/go /usr/local/bin/go

3. mkdir ~/gopath

4. 配置环境变量
 打开~/.bashrc:
  export PATH="$PATH:~/gopath/bin"
  export GOROOT=/usr/local/src/go
  export GOPATH=~/gopath
  export GO111MODULE=on
  export GOPROXY=https://goproxy.cn

5. source ~/.bashrc

6. go version
  go version go1.17.7 linux/amd64

posted @ 2022-09-27 16:01  小夜天  阅读(293)  评论(0编辑  收藏  举报