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)
4.调试运行部分,如果报错出现
couldnotlaunchprocess: exec:"lldb-server": executablefilenotfoundin$PATHProcessexiting 执行命令: xcode-select--install
网友评论