-
Notifications
You must be signed in to change notification settings - Fork 645
Debug test feature doesn't work for modules in gopath #2828
Comments
From #modules on the Gophers slack, it appears that relying on the output of |
This only affects the time when GO111MODULE is set to |
It only appears to affect auto |
@SteelPhase Can you elaborate on what changed in go 1.13 for GO111MODULE? |
I do believe the correct approach would be to use the result of https://golang.org/doc/go1.13#modules explains the changes to the meaning of |
Please try the latest beta version of this extension has the fix for this |
The latest update to this extension (0.11.8) has the fix for this. Thanks for reporting @SteelPhase Happy Coding! |
Example is here
Running
Run Unit Test
while this module is outside of the gopath will result in the test debugging correctly.Running
Run Unit Test
while this module is in the gopath will result in the test failing.It appears that the execution of dlv test differs for modules outside of the gopath
Running: /Users/steelphase/Code/Go/bin/dlv test --headless=true --listen=127.0.0.1:37823 --api-version=2 --log=true
Running: /Users/steelphase/Code/Go/bin/dlv test github.com/steelphase/vscode-go-2828/pkg/printer --headless=true --listen=127.0.0.1:47612 --api-version=2 --log=true
The offending code appears to be here. I think there needs to be an additional check that the workspace we are in even if in gopath is a module. This is was changed in go 1.13 when the default for
GO111MODULE
determines if project is a module differently.vscode-go/src/debugAdapter/goDebug.ts
Lines 433 to 439 in 9874b40
The text was updated successfully, but these errors were encountered: