-
Notifications
You must be signed in to change notification settings - Fork 645
Cursor "debug test" is not picking up GOPATH from launch.json #1057
Comments
Can you run the command |
It shows the correct GOPATH that is set in launch.json. It is also the same GOPATH in the workspace settings. I have no problems in running or debugging the program normally. This issue is only with the cursor "debug test" menu. Thank you for looking into this. |
What error do you see? Is it about dlv not being found? |
It fails because it cannot find dependencies. The "(from $GOROOT)" line in the error trace is pointing to a different directory. |
The error trace would have a line for $GOROOT and another for $GOPATH |
$GOPATH, not $GOROOT |
The $GOPATH in the error trace seems to point to $HOME/go/src. |
@goenning This feels like it is related to Can you take a look? I am leaving for a week long vacation without access to my Mac and so won't be able to get to the bottom of this @beforeisleep Thanks for your patience |
Hi, let me see if I can help. "debug test" doesn't load anything from launch.json as there could be multiple configurations and we wouldn't know which one to use. The current environment variables that are used during "debug test" are:
@beforeisleep can you add this to your settings.json file just to confirm my hypothesis.
If it does work, then @ramya-rao-a is right and my commit messed up with this. The |
The suggested change in settings.json, in fact, makes this problem go away. Thanks for looking into this. |
Thanks for the response. Stick with this workaround for now, I'll soon submit a PR. |
The fix is now out in the latest update (0.6.63) to the Go extension |
Hi @goenning , @ramya-rao-a I have an issue related to above, so wanted to check quickly before opening a new one. when I run the code lens "run test", I get the error
It is indeed a GOPATH issue. It works if
I have these settings on workspace level.
where can you please let me know thanks. |
@bsr203 The GOPATH from the In you second case above where you set GOPATH in the terminal and then open code, does the |
thanks @ramya-rao-a for getting back to me. No. |
hi. not sure what changed. after removing |
Why not use the setting |
@ramya-rao-a it works now. I have to use |
great, Happy Coding! |
This is the menu that displays when mouse hovers over test functions. It worked before recent VS Code update.
VS Code: 1.13.1
vscode-go: 0.6.62
Go: go1.8.1 darwin/amd64
The text was updated successfully, but these errors were encountered: