[英]How can I launch a debug session in VSCode with multiple go files?
I have two .go
files in the main
package.我在
main
package 中有两个.go
文件。 I can run them with command go run main.go plugin.go
.我可以使用命令
go run main.go plugin.go
运行它们。 I can also debug them with dlv dlv debug main.go plugin.go
.我也可以使用
dlv debug main.go plugin.go
来调试它们。
But I don't know how to debug them in VSCode, since the program
key in launch.json
can take only one go file as value.但我不知道如何在 VSCode 中调试它们,因为
launch.json
中的program
密钥只能将一个 go 文件作为值。
This is my launch.json
file这是我的
launch.json
文件
{
"name": "player",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/playerserver/main.go",
"args": ["playerserver.conf.json"]
}
Set param
attribute points to main package directory.设置
param
属性指向主 package 目录。
{
"name": "player",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "playerserver",
}
https://github.com/microsoft/vscode-go/issues/1229#issuecomment-473731132 https://github.com/microsoft/vscode-go/issues/1229#issuecomment-473731132
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.