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: not working on files outside gopath #33773

Closed
fastfading opened this issue Aug 22, 2019 · 3 comments
Closed

x/tools/cmd/guru: not working on files outside gopath #33773

fastfading opened this issue Aug 22, 2019 · 3 comments

Comments

@fastfading
Copy link

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

go version go1.12.7 darwin/amd64

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/xxxx/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xxxx/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.7/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.7/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/g4/b17y14y9753bsx3_f_03ggh80000gn/T/go-build017275408=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

use go tool guru , this tool only work in gopath.
but for many case the go project is not under gopath
~/go/bin/guru referrers /file.go:#1234

What did you expect to see?

guru show all the reference

What did you see instead?

if file.go:#1234 is a reference place
guru: no object for identifier: *ast.CallExpr
else if is a definition place
guru only show this definition

@bcmills bcmills changed the title go tool guru not working on files outside gopath x/tools/cmd/guru: not working on files outside gopath Aug 22, 2019
@gopherbot gopherbot added this to the Unreleased milestone Aug 22, 2019
@bcmills
Copy link
Contributor

bcmills commented Aug 22, 2019

Modules are the general solution for developing outside of GOPATH, and there is no current plan to convert guru to work with modules.

(See #31720 (comment).)

@bcmills bcmills closed this as completed Aug 22, 2019
@fastfading
Copy link
Author

fastfading commented Aug 23, 2019 via email

@bogdando
Copy link

reworked the workaround (symlinking script)

https://github.com/bogdando/gogetguru a script that workarounds that issue. This time it works much better, I hope.

@golang golang locked and limited conversation to collaborators May 14, 2021
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