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

GoDef doesn't follow the GOOS & GOARCH #521

Closed
ericwq opened this issue Aug 24, 2015 · 1 comment
Closed

GoDef doesn't follow the GOOS & GOARCH #521

ericwq opened this issue Aug 24, 2015 · 1 comment

Comments

@ericwq
Copy link

ericwq commented Aug 24, 2015

i have the following mapping in the .vimrc:

au FileType go nmap <Leader>dt <Plug>(go-def-tab)

while i browsing the golang source code.

$ pwd
/Users/ericwq/dev/go/src/os
$ vi file.go 

go to line 117 and try to find the definition of f.pread(b,off) with ",dt".
vim-go will jump to the file_plan9.go instead of file_unix.go!!!

in this case, the behavior of GoDef should consider the GOOS and GOARCH environment variable, or should consider the current opened file postfix (which define the Architecture and OS, such as amd64, linux).

func (f *File) pread(b []byte, off int64) (n int, err error) { 

one thing to mention: the golang source directory is not under the GOPATH.

$ env | grep GO
GOROOT=/usr/local/go
GOPATH=/Users/ericwq/dev/go_works
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ericwq/dev/go_works"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT=""
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
@fatih
Copy link
Owner

fatih commented Sep 14, 2015

Hi @ericwq. I think this is a godef problem. vim-go is just a wrapper. I think there is already a PR: rogpeppe/godef#1 Can you please open your issue there? Thanks

@fatih fatih closed this as completed Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants