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 does not work on Windows if g:go_build_tags is not specified #1865

Closed
ichitera opened this issue Jun 20, 2018 · 3 comments · Fixed by #1882
Closed

GoDef does not work on Windows if g:go_build_tags is not specified #1865

ichitera opened this issue Jun 20, 2018 · 3 comments · Fixed by #1882

Comments

@ichitera
Copy link

ichitera commented Jun 20, 2018

What did you do? (required. The issue will be closed when not provided.)

I executed :GoDef on the fmt.Println of the following file.

package main

import "fmt"

func main() {
	fmt.Println("vim-go")
	//  ^
	// the cursor was positioned here
}

NOTE: I used the latest guru.exe updated by :GoUpdateBinaries.

What did you expect to happen?

I expected that the definition of fmt.Println was opened.

What happened instead?

The following error was displayed.

vim-go: FAILED
vim-go: Run 'guru -help' for more information'
vim-go: D:\test

error

Configuration (MUST fill this out):

  • vim-go version: 155836d

  • vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):

language C

set runtimepath+=~/.vim/vim-go
filetype plugin indent on
syntax enable
  • Vim version (first three lines from :version):
VIM - Vi IMproved 8.1 (2018 May 17, compiled Jun 19 2018 22:03:51)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-89
  • Go version (go version): go1.10.3 windows/amd64

  • Go environment (go env):


set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\ichitera\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\ichitera\go
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\ichitera\AppData\Local\Temp\go-build810024502=/tmp/go-build -gno-record-gcc-switches

INFO

The argument -tags of guru.exe, obtained from g:go_build_tags, can be empty, and the empty argument of -tags '' seems to be ignored. I thought that :GoDef, hence, did not work on Windows.
empty argument seems to be ignored

Is g:go_build_tags mandatory option?

This issue relates to #1771.

@fatih
Copy link
Owner

fatih commented Jul 16, 2018

Hi @ichitera

Could you try #1882 please and report back if this fixes your issue?

@ichitera
Copy link
Author

Hi @fatih

I tried #1882 on the go file of the first comment of mine, and I could jump to the definition of fmt.Println by :GoDef. The issue seems to be fixed.
Thank you @fatih.

@fatih
Copy link
Owner

fatih commented Jul 16, 2018

Thanks @ichitera, I'm merging that PR.

fatih added a commit that referenced this issue Jul 17, 2018
fatih added a commit that referenced this issue Jul 17, 2018
fatih added a commit that referenced this issue Jul 18, 2018
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

Successfully merging a pull request may close this issue.

2 participants