1. Mac配置go的环境变量
(1)查看是否存在bash\_profile
cd ~/.bash_profil
(2)如果不存在则创建bash\_profile Mac环境配置文件
touch ~/.bash_profile
(3)打开bash\_profile
open -t ~/.bash_profile
~~~
export GOROOT=/usr/local/go
export GOPATH=/Users/anyi/go/gopath
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
~~~
(4)编译:source .bash\_profile
查看Go环境变量:go env