-
Notifications
You must be signed in to change notification settings - Fork 645
“Run without debugging” unable to run on macOs when used gomod. #3121
Comments
I was able to reproduce this issue with a minimal repro. My guess is that this is running explicitly in GOPATH mode. This needs investigation and a fix. |
Can any of you share the minimal repro case including the |
Ah, this was my mistake - I thought that this command came from the Go extension, but it comes from the user's @hawkwzh: What is the contents of your I've attached the repro. |
@stamblerre |
I think I know what's going on. Bug 1: When Bug 2: When the debug adapter receives the request with I will prepare a cl. When launch.json doesn't exist, |
Bug 1: when generating the default debug configuration because there is no user-configured one, the extension dropped noDebug field and caused the program to run with debugging enabled. Fix it (goDebugConfiguration.ts) Bug 2: when debug adapter receives noDebug request, it runs the program with `go run` instead of invoking the program through dlv. The `go run` will not work in modules mode if the command runs outside the main module. Set cwd accordingly. Fixes microsoft#3121 TESTED=manually with the example attached in microsoft#3121
…guration (#3125) * debug: fix 'run without debugging' Bug 1: when generating the default debug configuration because there is no user-configured one, the extension dropped noDebug field and caused the program to run with debugging enabled. Fix it (goDebugConfiguration.ts) Bug 2: when debug adapter receives noDebug request, it runs the program with `go run` instead of invoking the program through dlv. The `go run` will not work in modules mode if the command runs outside the main module. Set cwd accordingly. Fixes #3121 TESTED=manually with the example attached in #3121 * Handle case when debugConfiguration doesnt exist Co-authored-by: Ramya Achutha Rao <ramyar@microsoft.com>
The fix to this is available in the latest beta version of this extension. Please do try it out and share feedback |
@ramya-rao-a it's worked. |
The latest version of the extension has the fix to this issue |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code Insidersgo env GOOS GOARCH
to get the operating system and processor architecture detailsShare the Go related settings you have added/edited
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"git.enabled": false,
"window.zoomLevel": 0,
"workbench.iconTheme": "vscode-icons",
"editor.defaultFormatter": "ms-vscode.Go",
"go.autocompleteUnimportedPackages": true,
"extensions.ignoreRecommendations": false,
"go.docsTool": "gogetdoc",
"go.useLanguageServer": true
}
“Start debugging” can run ,but “Run without debugging” unable to run on macOs when used gomod.
log:
Verbose logs are written to:
/var/folders/5v/f083s3c147b8xhll1wng2_8m0000gq/T/vscode-go-debug.txt
InitializeRequest
InitializeResponse
Using GOPATH: /Users/fish/Documents/code/go_path
../../../../code/go_workspace/ro/main.go:5:2: package ro/local is not in GOROOT (/usr/local/go/src/ro/local)
Process exiting with code: 1
Sending TerminatedEvent as delve is closed
DisconnectRequest
DisconnectRequest to parent
My code:
Please check it.
The text was updated successfully, but these errors were encountered: