Skip to content

Commit 372c848

Browse files
fix(golangci_lint_ls): guard against missing golangci-lint in before_init (#4390)
1 parent 8a9378a commit 372c848

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lsp/golangci_lint_ls.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ return {
4747
before_init = function(_, config)
4848
-- Add support for golangci-lint V1 (in V2 `--out-format=json` was replaced by
4949
-- `--output.json.path=stdout`).
50+
51+
if vim.fn.executable('golangci-lint') ~= 1 then
52+
return
53+
end
54+
5055
local v1, v2 = false, false
5156
-- PERF: `golangci-lint version` is very slow (about 0.1 sec) so let's find
5257
-- version using `go version -m $(which golangci-lint) | grep '^\smod'`.

0 commit comments

Comments
 (0)