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

:GoInstallBinaries must be ru-run for every new invocation of vim #1164

Closed
PaulForgey opened this issue Jan 5, 2017 · 7 comments
Closed

Comments

@PaulForgey
Copy link

Behavior

vim-go: could not find 'guru'. Run :GoInstallBinaries to fix it.
Although $GOPATH/bin/guru does indeed exist, issuing :GoInstallBinaries fixes the issue but only for the current VIM session. New instances of vim go through the same problem.

Steps to reproduce:

  1. vim
  2. :GoDef (or any :Go command)
  3. observe error vim-go: could not find 'guru'. Run :GoInstallBinaries to fix it.
  4. :GoInstallBinaries
  5. :GoDef (now works)
  6. ':q'
  7. vim
    8.: GoDef
  8. observe error
  9. loop back to step 4.

Configuration

:echo $GOPATH
/Users/paulf/src/go
:!ls $GOPATH/bin
asmfmt gocode gogetdoc golint gorename guru motion
errcheck godef goimports gometalinter gotags impl

Add here your current configuration and additional information that might be
useful, such as:

  • vimrc you used to reproduce
    call plug#begin('~/.vim/plugins')

Plug 'fatih/vim-go', { 'tag': 'v1.10' }

call plug#end()

set lines=43 co=132

  • vim version:
    :ve
    VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 22 2016 11:16:35)
    MacOS X (unix) version
    Included patches: 1-94
    Compiled by MacPorts
    Huge version with MacVim GUI. Features included (+) or not (-):
    +acl +cursorbind +fullscreen +modify_fname +path_extra +syntax +viminfo
    +arabic +cursorshape +gettext +mouse -perl +tag_binary +vreplace
    +autocmd +dialog_con_gui -hangul_input +mouseshape +persistent_undo +tag_old_static +wildignore
    +balloon_eval +diff +iconv +mouse_dec +postscript -tag_any_white +wildmenu
    +browse +digraphs +insert_expand -mouse_gpm +printer -tcl +windows
    ++builtin_terms +dnd +job -mouse_jsbterm +profile +termguicolors +writebackup
    +byte_offset -ebcdic +jumplist +mouse_netterm -python +terminfo -X11
    +channel +emacs_tags +keymap +mouse_sgr -python3 +termresponse -xfontset
    +cindent +eval +lambda -mouse_sysmouse +quickfix +textobjects +xim
    +clientserver +ex_extra +langmap +mouse_urxvt +reltime +timers -xpm
    +clipboard +extra_search +libcall +mouse_xterm +rightleft +title -xsmp
    +cmdline_compl +farsi +linebreak +multi_byte -ruby +toolbar -xterm_clipboard
    +cmdline_hist +file_in_path +lispindent +multi_lang +scrollbind +transparency -xterm_save
    +cmdline_info +find_in_path +listcmds -mzscheme +signs +user_commands
    +comments +float +localmap +netbeans_intg +smartindent +vertsplit
    +conceal +folding -lua +num64 +startuptime +virtualedit
    +cryptv -footer +menu +odbeditor +statusline +visual
    -cscope +fork() +mksession +packages -sun_workshop +visualextra
    system vimrc file: "$VIM/vimrc"
    user vimrc file: "$HOME/.vimrc"
    2nd user vimrc file: "/.vim/vimrc"
    user exrc file: "$HOME/.exrc"
    system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    2nd user gvimrc file: "
    /.vim/gvimrc"
    defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
    fall-back for $VIM: "/opt/local/MacVim.app/Contents/Resources/vim"
    Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -I/opt/local/include
    -DMACOS_X_UNIX -pipe -Os -arch x86_64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
    Linking: /usr/bin/clang -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -o Vim -framework Cocoa -framework Carbon
    -lm -lncurses -liconv -lintl -framework Cocoa

  • vim-go version:
    r1.10

  • go version:
    go version go1.7.4 darwin/amd64

@fatih
Copy link
Owner

fatih commented Jan 7, 2017

Hi @PaulForgey

Vim reads the binaries from your PATH, if it's there you should be covered. Seems like it's not the case. :GoInstallBinaries is just a helper command, it's not required and you should not call it everytime. Please be sure you installed them correctly. Thanks

@fatih fatih closed this as completed Jan 7, 2017
@lylex
Copy link

lylex commented Jul 7, 2017

I ran into this embarrassing situation today, and I found that my $GOPATH/bin is not in the $PATH. In order to make several go projects use go-vim smoothly, I think move the binaries using by vim-go(e.g. guru) to $GOROOT/bin

@mrsiano
Copy link

mrsiano commented Dec 28, 2017

also, better to double check that a project being edited form go src e.g: vim $GOPATH/src/github.com/testing/test.go

@BlackMaria
Copy link

FYI for those who have this issue, and go is in their PATH. It is possible that the deps wont build either because of an issue with the dep itself, or more likely, your version of go is out of date, or its version is incompatible with one of the deps.

example: If you install golang-go in debian stretch using apt, golang will likely be too old. You are always suggested to install from the golang downloads page.

@peterwillcn
Copy link

peterwillcn commented May 7, 2019

Env set $GOBIN and :GoInstallBinaries fix it.

@samundra
Copy link

In my case, I had to add $GOROOT to $PATH to resolve this issue.

export PATH=$GOROOT:$GOROOT/bin:$PATH

Upon checking for PATH, I found out that GOROOT was not included. After adding it, vim-go stopped complaning about missing gopls.

Helpful commands:

# Check for env GOROOT  that is effectively in use
go env GOROOT
# Echo PATH variable and then print each one in separate line as shown in screenshot below
echo $PATH| tr ':' '\n'|sort -rn
Screenshot
Screen Shot 2022-08-30 at 14 26 57

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

8 participants