fatih / vim-go

Go development plugin for Vim
https://www.patreon.com/bhcleek
Other
15.98k stars 1.45k forks source link

Add config to exclude certain binaries from updating #3668

Open EVODelavega opened 4 months ago

EVODelavega commented 4 months ago

The only way to skip (or set a specific version) for the binaries installed via :GoInstallBinaries or :GoUpdateBinaries so far is to pass in a specific version. This works, but is somewhat clunky. Projects I'm working often use a specific version of golangci-lint as part of the CI. Instead of having to create mappings, or keep track of which versions and run the correct :GoUpdateBinaries golangci-lint@v1.2.3, I figured it'd be much easier to let me manage the version of that binary myself, and have :GoUpdateBinaries skip installing/updating that binary outright.

Another gripe I have with passing in specific versions of a binary is that, in order to skip one of the binaries, I'd need to list all of the binaries I do want to update (or update all, and then revert one to a specific version). IMHO, adding an exclude list is a much simpler solution, hence the PR.

When adding the docs for this new config variable, I also noticed a small typo in the docs for g:go_debug_breakpoint_sign_text.

bhcleek commented 3 months ago

Thank you for contributing again.

With this change, it looks like :GoUpdateBinaries cannot be used to explicitly install/update a binary that is in g:go_exclude_binaries. Given let g:go_exlude_binaries = ['dlv'], :GoUpdateBinaries dlv would refuse to update dlv, even though the user is explicitly requesting it.

I'm open to this change conceptually, but I believe users should be able to update a tool that's given as an explicit argument. WDYT?

EVODelavega commented 3 months ago

Hi, and yes. As it stands, the go_exclude_binaries list does override any and all attempts to install/update binaries, even if explicitly specified. I do agree that args passed directly to the commands ought to take precedence over config, so I've revisited the changes made here a bit, to skip the filtering if binaries are explicitly specified.

Thanks for the feedback.