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

path: return the unmodified GOPATH if autodetect is disabled #1280

Merged
merged 1 commit into from
May 8, 2017

Conversation

fatih
Copy link
Owner

@fatih fatih commented May 7, 2017

fixes #1257

@@ -134,8 +128,8 @@ function! go#path#BinPath() abort
elseif $GOBIN != ""
let bin_path = $GOBIN
else
" GOPATH (user set or default GO)
let bin_path = expand(go#path#Default() . "/bin/")
let go_paths = split(go#path#Default(), go#util#PathListSep())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fatih very much a drive-by comment... i.e. I haven't spent a huge amount of time looking into the context.

But can you not use go list to find the location of a binary?

go list -f '{{.Dir}}' github.com/nsf/gocode

That way you can avoid any assumptions about which part of GOPATH to use...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@myitcv this returns the path where the binaries might be installed, not the path of the binary itself. However I assume we can use your approach inside CheckBinPath() where it looks for the path of the binary itself

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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

Successfully merging this pull request may close these issues.

Change in default detection of GOPATH breaks when $GOPATH is a list
3 participants