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