VS Code golang debug 配置
实现效果 安装 delve windows go get -u github.com/go-delve/delve/cmd/dlv linux 方式一: go get -u github.com/go-delve/delve/cmd/dlv 方式二 $ git clone https://github.com/go-delve/delve.git $GOPATH/src/github.com/go-delve/delve $ cd $GOPATH/src/github.com/go-delve/delve $ make install 注意: 若果你go版本为1.5需要设置GO15VENDOREXPERIMENT=1 OSX $ go get -u github.com/go-delve/delve/cmd/dlv 执行上述代码前,确保你电脑上有编译工具 设置 launch.json 配置文件 ctrl+shift+p 输入 Debug: Open launch.json 打开 launch.json 文件,如果第一次打开,会新建一个配置文件,默认配置内容如下 { "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "go", "request": "launch", "mode": "auto", "program": "${fileDirname}", "env": {}, "args": [] } ] } 常见属性如下...