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

Manage tools using go modules #2456

Open
mbyio opened this issue Aug 16, 2019 · 6 comments
Open

Manage tools using go modules #2456

mbyio opened this issue Aug 16, 2019 · 6 comments

Comments

@mbyio
Copy link

mbyio commented Aug 16, 2019

I wasn't sure if the issue template was appropriate for this. Filled it out anyway. This is a feature request - it would be nice if vim-go used go modules to manage the integrated tools. That way, it can use its own, consistent versions (or users can specify their own versions), and go will take care of keeping everything organized. People wouldn't have to run :GoInstallBinaries or :GoUpdateBinaries anymore either, because Go would download the right ones automatically when they are asked for. I can help implement if it sounds interesting.

@bhcleek
Copy link
Collaborator

bhcleek commented Aug 16, 2019

You're exactly right, and I have a local branch where I'm working on exactly this using a proof of concept that we worked out last year. It turns out that you don't even actually need Go modules (e.g. in a go.mod) for this. Here's my acceptance criteria if you want to work on it:

  • :GoUpdateBinaries and :GoInstallBinaries needs to continue to work so all the tools can be installed updated to avoid delays when the user tries to use a tool that would otherwise not be installed yet.
  • a static go.mod is not required, because vim-go is not a Go module.
  • installing on demand is a nice to have, but not required.

We actually have most of the code, but just need to organize it and make sure it works as expected.

@mbyio
Copy link
Author

mbyio commented Aug 19, 2019

Cool! I figured someone else had already thought of doing this. My plate is full currently, but I may have time next week. Is the existing code in a branch somewhere?

@bhcleek
Copy link
Collaborator

bhcleek commented Aug 19, 2019

The code is in a stash on my local branch; it's not ready to be pushed any place yet.

@arp242
Copy link
Contributor

arp242 commented Aug 20, 2019

Note this already exists in the form of gopher.vim. It works pretty well. Most of the code for it is in autoload/gopher/system.vim.

a static go.mod is not required, because vim-go is not a Go module.

The advantage of adding a go.mod is that you can use all the regular Go tooling. Want to update stuff? go get -u, want to use a local copy? replace original => /path/to/replacement, etc. etc. I'm not sure how else to do it without reinventing the wheel on all of this?

@bhcleek
Copy link
Collaborator

bhcleek commented Aug 20, 2019

go.mod isn't needed at all, because go get will do just fine in module mode.

@arp242
Copy link
Contributor

arp242 commented Aug 20, 2019

How do you record which version to use?

@bhcleek bhcleek added this to the vim-go 1.22 milestone Aug 31, 2019
@bhcleek bhcleek removed this from the vim-go 1.22 milestone Jan 12, 2020
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

No branches or pull requests

3 participants