1. GO下载
1.1. 下载地址:https://www.golangtc.com/download (需要科学上网)
1.1.1. PKG安装:
下载这个包:go1.9.2.darwin-amd64.pkg
点点点,下一步就好了,环境变量也自动添加了。安装完成如下
zhangkedeMacBook-Pro:~ root# which go /usr/local/go/bin/go zhangkedeMacBook-Pro:~ root# echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin zhangkedeMacBook-Pro:~ root# go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/var/root/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build648898837=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config"
1.1.2. 二进制包
下载这个:go1.9.2.darwin-amd64.tar.gz