【Go学习之路】Mac 环境变量搭建

2,402 阅读1分钟

下载Go安装包

studygolang.com/dl

设置Go环境变量

  • vim ~/.bash_profile
  • 设置变量

按i进入编辑

export PATH=/uer/local/go/bin:$PATH
export GOROOT=/usr/local/go
export GOPATH=/Users/huangjiahong/GolangProjects
export GOBIN=/Users/huangjiahong/GolangProjects/bin 

编辑好后按esc退出编辑,然后:wq保存,保存失败的话按:wq!强制保存