【Go】 Go 语言环境安装

安装环境/工具

  1、Linux(CentOS 7.4版)

  2、go1.11.2.linux-amd64.tar

Go 语言环境安装

  1、下载安装包

    安装包下载地址为:https://golang.org/dl/。  

    如果打不开可以使用这个地址:https://golang.google.cn/dl/

    

  2、将下载的安装包解压至 安装目录(/data/soft)。

    命令:tar -xvf go1.11.2.linux-amd64.tar -C /data/soft/

  3、将 /data/soft/go/bin 目录添加至PATH环境变量,编辑文件/etc/profile

    命令:vim /etc/profile

    新增内容:

1 export GOROOT=/data/soft/go                                                                                
2 export PATH=$GOROOT/bin:$PATH 

    使新配置环境变量生效,命令:source /etc/profile

  4、测试环境变量,查看版本信息,命令:go version

    

猜你喜欢

转载自www.cnblogs.com/h--d/p/9976843.html