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

Default GOPATH not respected in vim-go #1243

Closed
spf13 opened this issue Mar 24, 2017 · 2 comments · Fixed by #1248
Closed

Default GOPATH not respected in vim-go #1243

spf13 opened this issue Mar 24, 2017 · 2 comments · Fixed by #1248
Labels

Comments

@spf13
Copy link

spf13 commented Mar 24, 2017

This is related to #1208 but I believe the problem is more widespread.

When the environment variable $GOPATH isn't set, Go 1.8 uses $HOME/go as the default.
In Vim the function :GoPath returns this path as expected however many operations depending on the $GOPATH being set don't work properly.

Vim-go can't identify the "Go binaries" are installed and a message is provided saying they aren't installed.
GoInstallBinaries can't identify existing binaries and re-installs them every time it's run.

GoCode can't be found and many features don't work.

GoFmt can't be found and an error is returned on file save.

I'm sure there are many similar manifestations of this similar issue.

It's easy to reproduce. Simply stop exporting $GOPATH and try to use vim-go.

@fatih
Copy link
Owner

fatih commented Mar 28, 2017

Hi @spf13

I'm working on this. Already fixed :GoPath and :GoInstallBinaries, however the problem is deeper than I've imagined. It needs a serious refactor. I'm now doing it. It'll be included into the next release as well. Thanks for the feedback.

@fatih fatih added the bug label Mar 28, 2017
fatih added a commit that referenced this issue Mar 29, 2017
This PR fixes the following cases:

* If no GOPATH is set, vim-go uses the default GOPATH via `go env
  GOPATH` (starting Go 1.8)
* `:GoPath` now shows the correct `GOPATH` if no GOPATH is set
* `:GoInstallBinaries` now installs to the correct GOPATH if no GOPATH
  is set

fixes #1243
fatih added a commit that referenced this issue Mar 29, 2017
This PR fixes the following cases:

* If no GOPATH is set, vim-go uses the default GOPATH via `go env
  GOPATH` (starting Go 1.8)
* `:GoPath` now shows the correct `GOPATH` if no GOPATH is set
* `:GoInstallBinaries` now installs to the correct GOPATH if no GOPATH
  is set

fixes #1243
fatih added a commit that referenced this issue Mar 29, 2017
This PR fixes the following cases:

* If no GOPATH is set, vim-go uses the default GOPATH via `go env
  GOPATH` (starting Go 1.8)
* `:GoPath` now shows the correct `GOPATH` if no GOPATH is set
* `:GoInstallBinaries` now installs to the correct GOPATH if no GOPATH
  is set

fixes #1243
@fatih
Copy link
Owner

fatih commented Mar 30, 2017

Fixed with #1248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants