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: no object for identifier #20981

Closed
CMGS opened this issue Jul 11, 2017 · 5 comments
Closed

x/tools/cmd/guru: no object for identifier #20981

CMGS opened this issue Jul 11, 2017 · 5 comments

Comments

@CMGS
Copy link

CMGS commented Jul 11, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.8.3 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/CMGS/.go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jy/197q2fws1hl8blgfvnj50n500000gn/T/go-build540419658=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

I'm using guru to find object's definitions in my project under it's dir. I'm running it's as it should be:
guru definition 'cluster/calcium/create_container.go:#734'
which specifies bytes position of start of a my object. I run it inside vim-go, but it's don't work even if I ran it by hand from command line.

my project was not under $GOPATH but I link the dir to $GOPATH/src/github.com/CMGS/project. it can build normally and successfully.

in vim, godef can work as I expect, YCM can find definition and auto complete accurately, only guru not working well.

What did you expect to see?

I expect to find out a position where this element was defined.

What did you see instead?

guru: no object for identifier

@mvdan
Copy link
Member

mvdan commented Jul 11, 2017

You seem to imply you're using a symlink. Is that correct?

For what it's worth, GOPATH is not required to work with symbolic links. See #15507. guru isn't required to support them.

@CMGS
Copy link
Author

CMGS commented Jul 11, 2017

@mvdan yes, I use symlink for build project without vendor. so how can I use guru to find object's definitions or something else in this case? copy whole dir to $GOPATH ?

@mvdan
Copy link
Member

mvdan commented Jul 11, 2017

Depends on what you were using symlinks for in the first place. You could use a hard link. You could keep the code only inside GOPATH. You could do the symlink the other way.

Also see #17271.

CC @alandonovan in case he wants to work on a fix, but I presume this will be closed as wontfix.

@CMGS
Copy link
Author

CMGS commented Jul 11, 2017

hmmm, thank you @mvdan , I will try hard link. hope #17271 become true, it can solve many develop problems in old projects like me.

@CMGS CMGS closed this as completed Jul 11, 2017
@mikioh mikioh changed the title guru: no object for identifier x/tools/cmd/guru: no object for identifier Aug 2, 2017
@sandipb
Copy link

sandipb commented Mar 13, 2018

Directory hardlinks are no longer supported on OSX (High Sierra) with the default APFS filesystem.

I get that guru is not required to support symlinks because symlinks in GOPATH are not officially supported. But Guru has a different target audience than Go - it is widely used for helping editors and IDEs, which are typically used only on major operating systems. This is unlike Go itself, which has a better excuse for not supporting symlinks - it is not usable on all the operating systems it targets.

Given that, it would really be helpful if Guru would support symlinks. If there any technical reason to find it problematic to implement, it would be helpful to understand the reluctance.

@golang golang locked and limited conversation to collaborators Mar 13, 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

4 participants