Skip to content
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

x/tools/cmd/gopls: GoToDef does not work inside $GOPATH/pkg/mod #31056

marwan-at-work opened this issue Mar 26, 2019 · 1 comment

x/tools/cmd/gopls: GoToDef does not work inside $GOPATH/pkg/mod #31056

marwan-at-work opened this issue Mar 26, 2019 · 1 comment


Copy link

@marwan-at-work marwan-at-work commented Mar 26, 2019


When you're inside a Go project and GoToDef to a third party library, things work. However, you cannot continue GoingToDef from within the newly opened file that is inside $GOPATH/pkg/mod.


# be outside of GOPATH
1. ~ git clone
2. ~ cd authproxy
3. ~ go build ./...
4. ~ code . # open VSCode pointed at this prject

5. Open the cmd/authproxy/main.go file and go to line 21 that reads `envconfig.MustProcess("", &config)` 

6. Hover over the `MustProcess` part and GoToDef 

7. This should open up a new file at $GOPATH/pkg/mod/ 

8. From that file try to GoToDef to any symbol: i.e. like line 90: Process function

Expected: go to def should work and go to the Process function.
Actual: nothing happened.

Furthermore, hover info doesn't work either so maybe nothing works.

Editor Settings

Editor: VSCODE
GoPls Settings:

    "atomKeymap.promptV3Features": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "editor.formatOnPaste": true,
    "window.zoomLevel": 0,
    "editor.fontSize": 12,
    "editor.lineHeight": 22,
    "go.buildOnSave": "off",
    "go.vetOnSave": "off",
    "go.useLanguageServer": true,
    "go.alternateTools": {
        "go-langserver": "gopls"
    "go.languageServerExperimentalFeatures": {
        "format": false,
        "autoComplete": true,
        "rename": true,
        "goToDefinition": true,
        "hover": true,
        "signatureHelp": true,
        "goToTypeDefinition": true,
        "goToImplementation": true,
        "documentSymbols": true,
        "workspaceSymbols": true,
        "findReferences": true
    "go.lintTool": "golint",
    "go.coverageDecorator": {
        "type": "highlight"
    "editor.hideCursorInOverviewRuler": false,
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "source.organizeImports": true,
    "breadcrumbs.enabled": true
@gopherbot gopherbot added this to the Unreleased milestone Mar 26, 2019
Copy link

@stamblerre stamblerre commented May 21, 2019

I believe that this is now fixed (I can no longer reproduce the issue).

@stamblerre stamblerre closed this May 21, 2019
@golang golang locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.