-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
GoErrCheck doesn't work in projects inside secondary GOPATH #1151
Comments
I can get :GoErrCheck to run by modifying
One problem seems to be that Another problem is that Neovim won't match any of the paths once they've been escaped (including the one where the project lives): If I save the following to "match.vim"
and run it with
which seems kind of weird. This happens in both Vim and Neovim on my machine. |
Sorry for the very late response. This is fixed now and pushed to master. I'm using now by default |
Behavior
Running :GoErrCheck in a project that lives in a secondary directory in GOPATH fails.
Steps to reproduce:
Suppose we've setup our GOPATH to have more than one directory, perhaps like this:
If we now start a project in the first of these, say "$HOME/work/go/src/hello", then running :GoErrCheck fails with the error message
Thoughts on the problem
As far as I can tell, the problem is in the call to
go#package#ImportPath
ingo#lint#Errcheck
. The for loop in there always assignsworkspace
to the last of the dirs in GOPATH that passed the if check, and then assumes the project lives inside that directory. It then fails to dig the package name out of the absolute path. In our example, it tries to find the package name by deletingfrom
This of course deletes nothing, so we try to call
which fails with the error message above.
Configuration
Add here your current configuration and additional information that might be
useful, such as:
vimrc
you used to reproduce:call plug#begin('~/.config/nvim/plugged')
Plug 'fatih/vim-go', { 'do': 'GoInstallBinaries' }
call plug#end()
vim version: Neovim 0.1.6
vim-go version: Git commit e46dd4d from December 17, 2016
go version: go1.7.3 darwin/amd64
The text was updated successfully, but these errors were encountered: