苹果和win10直接安装文件即可
提供在Linux下的安装方法:
1、sudo apt install go
2、从(http://golang.org/dl/)下载最新版本的go语言二进制档案包
3、推荐安装到/usr/local下go目录
设置环境变量:
vim /etc/profileexport GOROOT=/opt/go
#设置为go安装的路径
export GOPATH=/code/goDemo
#默认安装包的路径
export PATH=$PATH:$GOROOT/bin:$GOPATH/binsource /etc/profile
Linux下的设置方法(1)
需要设置什么?
有3个环境变量需要设置:GOROOT/GOPATH/GOBIN,以及PATH需要设置到某一个profile文件中(!/.bash_profile或/etc/profile)
Linux下的设置方法(2)
GOROOT: 该环境变量的值应该为GO语言的当前安装目录,例如:
expor GOROOT=/usr/local/go