Navigation Menu

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/guru: go to def "no object for identifier" within downloaded module #29344

Closed
voutasaurus opened this issue Dec 19, 2018 · 1 comment

Comments

@voutasaurus
Copy link

What did you do?

vim-go uses guru for :Godef. This doesn’t seem to work for looking up definitions in dependencies that have been downloaded as modules. For instance I can go to a definition and it will take me into the specific file in that dependency (e.g. ~/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20181203162652-d668ce993890/oauth2.go). :GoDef within that file works, but jumping to a definition in the same package in a different file does not work (e.g. :GoDef on Token says vim-go: guru: no object for identifier)

Here's an example repo as a jumping off point:
https://github.com/voutasaurus/oauthtest/tree/2aac50ff8003ec8f56ac1f71f78efc00cd130a97

The file:
https://github.com/voutasaurus/oauthtest/blob/2aac50ff8003ec8f56ac1f71f78efc00cd130a97/cmd/web/main.go

Use existing go.mod in the repo.

:GoDef on oauth2.Config, then from oauth2.go use :GoDef on TokenSource (this works), then use :GoDef on Token. This gives the error: vim-go: guru: no object for identifier.

What did you expect to see?

I expected to be taken to the definition of Token in ~/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20181203162652-d668ce993890/token.go

What did you see instead?

The error: vim-go: guru: no object for identifier.

Does this issue reproduce with the latest release (go1.11.4)?

Yes I also tested with go1.11.4 and the same error occurs.

System details

go version go1.12beta1 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/vout/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/vout/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/vout/sdk/go1.12beta1"
GOTMPDIR=""
GOTOOLDIR="/Users/vout/sdk/go1.12beta1/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOROOT/bin/go version: go version go1.12beta1 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.12beta1
uname -v: Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:31 PST 2018; root:xnu-4903.231.4~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.14.2
BuildVersion:	18C52a
lldb --version: lldb-1000.0.38.2
  Swift-4.2
@gopherbot gopherbot added this to the Unreleased milestone Dec 19, 2018
@voutasaurus
Copy link
Author

Apologies, this is a duplicate (subset) of #24661

@golang golang locked and limited conversation to collaborators Dec 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants