-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug sub folder in Go project not work as expected #509
Comments
I tried to load the configurations from |
You need to specify the full package path when using Go modules. If your module path (specified by Alternatively, use filesystem path: I don't use VSCode, so take this with a grain of salt. I'm not sure why the launch.json works on VSCode, but they specified the following in the documentation:
Which aligns with the explanation above. |
Do you mean set |
Found the solution. {
type = "go",
name = "Debug cmd folder",
request = "launch",
program = "${workspaceFolder}/cmd",
cwd = "${workspaceFolder}",
showLog = true,
args = { "server" }
} I need to set value to both |
I believe |
You're correct, |
for gloang, cwd should represent where the go.mod files are located... however this does not work. So if your project folder has automation tests in python outside the main golang app folder, you can't have the vscode/launch.json at the root of the project and have it cover all options, it must reside within the app folder to have access to the go.mod file. |
Debug adapter definition and debug configuration
Debug adapter version
1.8.2
Steps to Reproduce
Here is the structure of my Go project
The entry point of the project is the
cmd/main.go
file. To run the project, rungo run cmd/*.go
command.Run the debug options named
Debug cmd folder
.I have tried the same configuration in the VsCode and it works as expected, however, when I run that configuration on neovim, I got this error
Expected Result
The dap works correctly because that configuration works well on VsCode.
VsCode configuration
Actual Result
Cannot launch the debug.
The text was updated successfully, but these errors were encountered: