# Mac VSCode Golang 配置
1. https://golang.org/dl/ 选择pkg自动安装包,然后在.bash_profile中配置自定义的GOPATH
eg:
export GOROOT=/usr/local/go
export GOPATH=/Users/lz/GoglandProjects
export PATH=$PATH:$GOROOT/bin:/usr/local/git/bin
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
2.执行命令
mkdir -p $GOPATH/src/golang.org/x&&cd $GOPATH/src/golang.org/x&& git init && go get github.com/derekparker/delve/cmd/dlv && go get github.com/kardianos/govendor&&git clone https://github.com/golang/tools.git
3.进入VSCode,新建一个main.go文件,根据提示点击installAll,安装静态解析库 ,等待安装完成。
==note:== ==(第一次进入需要配置VSCode)==
![image](http://i2.bvimg.com/618828/4fec2dc233c55bb1.jpg)
4.调试运行部分,如果报错出现
could not launch process: exec: "lldb-server": executable file not found in $PATH Process exiting
执行命令: xcode-select --install
有疑问加站长微信联系(非本文作者))