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

Add non-standard workspaces to package path list #861

Merged
merged 1 commit into from
May 18, 2016
Merged

Add non-standard workspaces to package path list #861

merged 1 commit into from
May 18, 2016

Conversation

DeepAnchor
Copy link
Contributor

Allows guru tools to work with gb, godep, etc

Allows guru tools to work with gb, godep, etc
@fatih
Copy link
Owner

fatih commented May 18, 2016

Hi @DeepAnchor

Thanks for your contribution. Can you please give a detail on how guru uses this and what it improves?

@DeepAnchor
Copy link
Contributor Author

Sure. Guru tools such as implements, describe, callees, callers, etc., rely on being able to find package import paths to perform its analysis. Currently, go#package#Paths() only scans $GOROOT and the default $GOPATH to find these import paths, causing guru commands to fail when projects are located elsewhere with the message "current directory is not inside of a valid GOPATH".

For example when using gb, projects could be located in an arbitrary location outside of $GOPATH and vim-go will fail to recognize them as valid workspaces, causing all guru commands to fail. With this patch, the current workspace will be detected at runtime using go#path#Detect() instead of $GOPATH which will allow guru to find the proper import paths.

@fatih
Copy link
Owner

fatih commented May 18, 2016

Thanks for the clarification @DeepAnchor. I've asked because the function is being used a lot every where else and we still don't have tests (I hope I'll start them soon) to see the global affect I need to be careful while picking stuff.

@fatih fatih merged commit 5d5a5b2 into fatih:master May 18, 2016
@DeepAnchor
Copy link
Contributor Author

No problem, better safe than sorry!

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.

None yet

2 participants