Vim-go: :GoInfo command triggers [gocode] FAIL

Created on 18 Nov 2018  路  6Comments  路  Source: fatih/vim-go

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

Using this repo as an example, I placed my cursor onto various identifiers (variables, types, functions etc) and would execute :GoInfo.

What did you expect to happen?

I expected to see information related to the selected identifier.

What happened instead?

The following error was shown:

vim-go: [gocode] FAIL

Configuration (MUST fill this out):

  • vim-go version: 0a39696

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

call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go'
call plug#end()
let g:go_fmt_command = 'goimports'
let g:go_metalinter_autosave = 1
let g:go_metalinter_autosave_enabled = ['vet', 'golint', 'errcheck', 'deadcode', 'structcheck', 'dupl', 'interfacer', 'goconst']
let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck', 'deadcode', 'structcheck', 'dupl', 'interfacer', 'goconst']
let g:go_metalinter_deadline = '20s'
  • Vim version (first three lines from :version):
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb  7 2018 14:05:03)
macOS version
Included patches: 1-1450
  • Go version (go version):
go version go1.11.2 darwin/amd64
  • Go environment (go env):
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/markmcdonnell/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/markmcdonnell/code/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.2/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/3m/3pnsckx15wgdv5cpynbtz4b40000gn/T/go-build890545837=/tmp/go-build -gno-record-gcc-switches -fno-common"

Most helpful comment

So a GoUpdateBinaries looks to have done the trick.

All 6 comments

I am not able to duplicate the problem you describe. FWIW, I'm currently using github.com/mdempsky/gocode@0af7a86943a6e0237c90f8aeb74a882e1862c898.

When did you last update gocode? Are you working in GOPATH or in module aware mode?

When did you last update gocode?

I had updated vim-go to latest version and then called the :GoInstallBinaries command where gocode was subsequently installed.

Are you working in GOPATH or in module aware mode?

I had the repo within the gopath, it's not outside the gopath, nor is it setup with .mod module support.

Does :messages show you anything useful? If not, then:

  1. run gocode exit to make sure that gocode is shutdown. (verify it was shutdown withps ax | grep gocode
  2. run gocode -s -debug in a shell to start the gocode server.
  3. put let g:go_debug=['shell-commands'] and run :GoInfo again. You'll have an entry in :messages for how gocode is actually being called.

Does the server display any useful messages? If not, then does running the gocode client command in a shell from the directory that contains your buffer offer anything useful?

I had updated vim-go to latest version and then called the :GoInstallBinaries command where gocode was subsequently installed.

:GoInstallBinaries only installs missing binaries; it does not update existing ones.

So a GoUpdateBinaries looks to have done the trick.

Thanks for your help debugging.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wpaulino picture wpaulino  路  4Comments

groob picture groob  路  3Comments

zhangjing picture zhangjing  路  3Comments

danielmanesku picture danielmanesku  路  4Comments

preslavmihaylov picture preslavmihaylov  路  3Comments