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

disable g:go_autodetect_gopath by default #1461

Merged
merged 1 commit into from
Oct 18, 2017

Conversation

bhcleek
Copy link
Collaborator

@bhcleek bhcleek commented Sep 16, 2017

Disable g:go_autodetect_gopath by default since first class support for
vendoring was enabled in Go by default a year and a half ago in Go 1.6
and most vendoring tools use it. At this point, there is a greatly
reduced need to detect whether the old method used by Godep and gb is in
effect.

@arp242
Copy link
Contributor

arp242 commented Sep 18, 2017

Personally, I think that the fewer tricks we play with GOPATH the better, so 👍.

There is the additional issue that right now go#path#Detect() is applied fairly inconsistently; it's called only for some commands not others.

So I would propose going a step further and removing the go#path#Detect() calls from the commands and instead hooking in to the FileType autocommand instead when g:go_autodetect_gopath is enabled.

@bhcleek
Copy link
Collaborator Author

bhcleek commented Sep 21, 2017

I agree that using FileType autocommands offers a better method to detect GOPATH, but I think that's a separable task, and I'd prefer to tackle it in a separate PR (I'll do that as my next contribution).

@bhcleek
Copy link
Collaborator Author

bhcleek commented Sep 23, 2017

@Carpetsmoker are you on board with merging this as is?

@arp242
Copy link
Contributor

arp242 commented Sep 24, 2017

@Carpetsmoker are you on board with merging this as is?

Yeah, sure. It would be good to get @fatih's input on this too though.

@arp242 arp242 requested a review from fatih October 14, 2017 01:31
@fatih
Copy link
Owner

fatih commented Oct 18, 2017

While at this, we should also remove the autodetection completely. The whole logic around godep and gb is not needed in my opionion. With vendor/ people know have the ability of Project based Go applications.

CHANGELOG.md Outdated
@@ -22,6 +22,8 @@ IMPROVEMENTS:

let g:go_list_type_commands = {"GoBuild": "quickfix", "GoTest": "locationlist"}

* Disable `g:go_autodetect_gopath` by default [[GH-1461]](https://github.com/fatih/vim-go/pull/1461).
Copy link
Owner

Choose a reason for hiding this comment

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

Can you move this up to the latest changelog? This seems to be in the old place as we released a new version.

@fatih
Copy link
Owner

fatih commented Oct 18, 2017

lgtm after the changelog fix 👍

Disable g:go_autodetect_gopath by default since first class support for
vendoring was enabled in Go by default a year and a half ago in Go 1.6
and most vendoring tools use it. At this point, there is a greatly
reduced need to detect whether the old method used by Godep and gb is in
effect.
@bhcleek bhcleek merged commit 51dbbc4 into fatih:master Oct 18, 2017
@bhcleek bhcleek deleted the gopath-autodetect-default branch October 18, 2017 21:55
@bhcleek bhcleek mentioned this pull request Nov 13, 2017
arp242 added a commit that referenced this pull request Nov 25, 2017
* Remove g:go_autodetect_gopath

Follow-up to #1461.

Needs a bit more testing.

* Put it back for gocode

* Move GOPATH detection to autocmd

* Fix PR feedback from Billy

* unlet b:old_gopath

* Add basic test

* Update changelog

* Hmm, forgot I already added a test for this.

* Distinguish between GOPATH= and GOPATH never being set

* shorter
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.

3 participants