Using this repo as an example, I placed my cursor onto various identifiers (variables, types, functions etc) and would execute :GoInfo.
I expected to see information related to the selected identifier.
The following error was shown:
vim-go: [gocode] FAIL
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'
: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 go1.11.2 darwin/amd64
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"
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:
gocode exit to make sure that gocode is shutdown. (verify it was shutdown withps ax | grep gocodegocode -s -debug in a shell to start the gocode server.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.
Most helpful comment
So a
GoUpdateBinarieslooks to have done the trick.