Centos7安装Go-1.13.5

goimage.png

  • 下载安装包:

    wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz
  • 解压到指定目录

    tar -C /usr/local -xzf go1.13.5.linux-amd64.tar.gz
  • 配置环境变量

    vim /etc/profile
    # 插入下面两行
    export GOROOT=/usr/local/go
    export PATH=$PATH:$GOROOT/bin
  • 设置 GOPATH 编译目录,需要编译的项目都应该放到该目录

    mkdir -p /home/gopath
    vim /etc/profile
    export GOPATH=/home/gopath
  • 验证安装成功

    go version
    go version go1.13.5 linux/amd64
Last modification:January 8th, 2020 at 08:30 pm
If you think my article is useful to you, please feel free to appreciate