@@ -37,8 +37,7 @@ coc-settings.json
37
37
" command" : " golangci-lint-langserver" ,
38
38
" filetypes" : [" go" ],
39
39
" initializationOptions" : {
40
- " command" : [" golangci-lint" , " run" , " --out-format" , " json" , " --issues-exit-code=1" ]
41
- }
40
+ " command" : [" golangci-lint" , " run" , " --output.json.path" , " stdout" , " --show-stats=false" , " --issues-exit-code=1" ]
42
41
}
43
42
}
44
43
}
@@ -52,7 +51,7 @@ augroup vim_lsp_golangci_lint_langserver
52
51
autocmd User lsp_setup call lsp#register_server ({
53
52
\ ' name' : ' golangci-lint-langserver' ,
54
53
\ ' cmd' : {server_info- > [' golangci-lint-langserver' ]},
55
- \ 'initialization_options': {'command': ['golangci-lint', 'run', '--out-format ', 'json ', '--issues-exit-code=1']},
54
+ \ ' initialization_options' : {' command' : [' golangci-lint' , ' run' , ' --output.json.path ' , ' stdout ' , ' --show-stats=false ' , ' --issues-exit-code=1' ]},
56
55
\ ' whitelist' : [' go' ],
57
56
\ })
58
57
augroup END
@@ -74,8 +73,7 @@ if not configs.golangcilsp then
74
73
cmd = {' golangci-lint-langserver' },
75
74
root_dir = lspconfig .util .root_pattern (' .git' , ' go.mod' ),
76
75
init_options = {
77
- command = { " golangci-lint" , " run" , " --out-format" , " json" , " --issues-exit-code=1" };
78
- }
76
+ command = { " golangci-lint" , " run" , " --output.json.path" , " stdout" , " --show-stats=false" , " --issues-exit-code=1" };
79
77
};
80
78
}
81
79
end
@@ -106,5 +104,10 @@ language-servers = [ "gopls", "golangci-lint-lsp" ]
106
104
command = " golangci-lint-langserver"
107
105
108
106
[language- server .golangci - lint- lsp .config ]
109
- command = [" golangci-lint" , " run" , " --out-format " , " json " , " --issues-exit-code=1" ]
107
+ command = [" golangci-lint" , " run" , " --output.json.path " , " stdout " , " --show-stats=false " , " --issues-exit-code=1" ]
110
108
` ` `
109
+
110
+ ## golangci-lint Version Compatibility
111
+
112
+ - For golangci-lint v2+: Use ` -- output .json .path stdout -- show- stats= false ` parameters
113
+ - For golangci-lint v1: Use ` -- out- format json` parameter
0 commit comments