Mac下安装go
基于Homerbrew安装,方便管理跟升级
brew install go
配置路径
vim ~/.bash_profile
#export PATH
export GOROOT=/usr/local/Cellar/go/1.8.1/libexec
export GOBIN=$GOROOT/bin
export GOPATH=/Users/antic/www/go
export PATH=$PATH:$GOBIN
让配置立即生效
source .bash_profile
查看
go env
antic:~ antic$ go env
GOARCH="amd64"
GOBIN="/usr/local/Cellar/go/1.8.1/libexec/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/antic/www/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dw/35ddtk3n68d3p_sy3052gzr80000gn/T/go-build692262960=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
开发工具
有疑问加站长微信联系(非本文作者)