refactor: go.nvim build checks for go binary before installing tools

This commit is contained in:
QQ 2026-06-10 22:58:26 +08:00
parent 94274b126a
commit 4acadc3ae4
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,11 @@ return {
"nvim-treesitter/nvim-treesitter",
},
ft = { "go", 'gomod' },
build = ':lua require("go.install").update_all_sync()',
build = function()
if vim.fn.executable('go') == 1 then
require("go.install").update_all_sync()
end
end,
config = function()
require("go").setup()
end,