下载
官网镜像下载:https://golang.org/dl/
国内镜像下载:https://studygolang.com/dl
Go环境搭建
配置GO环境变量GOPATH和GOBIN
打开Mac终端,编辑.bash_profile文件,命令行输入:
vi ~/.bash_profile
或者
open -e .bash_profile
在.bash_profile文件中添加环境变量
export PATH=${PATH}:/usr/local/go/bin
编译使其生效,终端输入:
source ~/.bash_profile
查看相关信息
查看Go版本
go version
查看Go环境变量
go env
以mac为例,安装pkg安装包