ray-x / go.nvim

G'day Nvimer, Joyful Gopher: Discover the Feature-Rich Go Plugin for Neovim
MIT License
1.93k stars 119 forks source link

Ensure correct tools installation in goenv mode #332

Closed faustind closed 1 year ago

faustind commented 1 year ago

Tools will be installed in the appropriated directory when goenv manages GOPATH.

I tried to make it work on Mac, Linux (Ubuntu), ~and Windows but I have no way of testing it on Windows~ 😅

goenv doesn't seem to be supported on Windows.

ray-x commented 1 year ago

Hi, @faustind Thanks for the PR. The only concern I have is goenv_mode will be called each time when go.nvim needs to execute a binary. Could you add a local dict so the result will be stored locally? e.g. in utils.lua

local installed = {}
...
if installed['gomodifytags'] then return true end
else
-- check if it installed
-- if installed
installed['gomodifytags'] = true
return true
faustind commented 1 year ago

@ray-x, Thanks for the suggestion. I cached the information about the installed tools in utils.lua in 9442967.

But the tests for gotags appear to randomly fail: I had the same jobs run on the same commit on my fork here.

I suspect the 100ms wait for gotags action to take effect is not enough. So I bumped the wait time from 100ms to 500ms for go_tags_spec.lua in 8112fbc

EDIT:

... but I am not sure what is the issue here. In case setting the wait time to 500ms is not the appropriate action, please advise 🙏🏾

ray-x commented 1 year ago

Timeout error might be caused by github actions. Sometimes there is more traffic.