简体   繁体   中英

How can I launch a debug session in VSCode with multiple go files?

I have two .go files in the main package. I can run them with command go run main.go plugin.go . I can also debug them with dlv 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.

This is my launch.json file

{
        "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.

{
  "name": "player",
  "type": "go",
  "request": "launch",
  "mode": "auto",
  "program": "playerserver",
}

https://github.com/microsoft/vscode-go/issues/1229#issuecomment-473731132

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM