"GOPATH":"D:/Develop/vscodegolang" }, "args": [], "showLog": true } ] } 其中"post","host"都是go插件自动生成的,“env”为设置环境变量,设置为工程目录包含bin、src的文件夹 回到顶部 准备调试插件 选中要调试的main.go,点击F5会报错误提示:Failded to continue:"Cannot find Delve debugger. I...
2、然后打开当前项目目录,左边点调试选项,点击添加配置,生成了一个launch.json文件,其内容如下: {// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version":"0.2....
2、设置debug配置文件 3、配置文件参考 { // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Golang", "type": "go", "request": "launch", ...
debug的时候需要配置launch.json,只需要在launch.json配置输入即可 {//UseIntelliSensetolearnaboutpossibleattributes.//Hovertoviewdescriptionsofexistingattributes.//Formoreinformation,visit:https://go.microsoft.com/fwlink/?linkid=830387"version":"0.2.0","configurations":[{"name":"Launch Package","type":"...
{"version":"0.2.0","configurations":[{"name":"Debug Go","type":"go","request":"launch","mode":"debug","program":"${workspaceFolder}/main.go","args":[],"env":{},"showLog":true}]} 1. 2. 3. 4. 5. 6. 7. 8.
【go】VSCode配置Go插件和debug设置 1 插件安装 2 debug设置 点击创建 复制一下代码替换 {// 使用 IntelliSense 了解相关属性。// 悬停以查看现有属性的描述。// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387"version":"0.2.0","configurations": [ {"name":"Golang","type"...
“mode”: “debug”, “program”: “${fileDirname}”, “env”: {}, “args”: [] } ] } “` 保存该文件后,现在你可以按下 `F5` 键来运行你的 Go 代码了。VSCode 将会在调试控制台中显示输出结果。 6. 设置断点:如果想要在代码中设置断点,只需在你想要停下来的行上单击左侧的空白区域。然后按...
linkid=830387"version":"0.2.0","configurations":[{"name":"Launch","type":"go","request":"launch","mode":"auto","program":"${workspaceRoot}/main.go","buildFlags":"-mod=vendor",// 使用vendor模式"env":{"xxxEnv":"on"},// 环境变量"args":["-config","xxx.toml"]// 启动参数}...
"version":"0.2.0","configurations":[{"name":"Launch","type":"go","request":"launch","mode":"auto","program":"${fileDirname}",//调试程序的路径(绝对路径) ${fileDirname} 调试当前文件所在目录下的所有文件"env":{},"args":[]}]} ...