diff --git a/CHANGELOG.develop b/CHANGELOG.develop index d5845d4e6..b3ea5e17a 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -1300,6 +1300,8 @@ Other: - Added lsp support (thanks to Lupco Kotev) - Added golangci-lint support (thanks to Lupco Kotev) - Add toggle control for verbose go test output (thanks to Enze Chi) +- Set lsp-prefer-flymake to :none when Go layer is using LSP (thanks to Tim + Heckman) **** Graphviz - Use graphviz package from melpa (thanks to Matthew Boston) **** Groovy diff --git a/layers/+lang/go/funcs.el b/layers/+lang/go/funcs.el index 9778a5fda..a9064f38c 100644 --- a/layers/+lang/go/funcs.el +++ b/layers/+lang/go/funcs.el @@ -37,7 +37,13 @@ (defun spacemacs//go-setup-backend-lsp () "Setup lsp backend" (if (configuration-layer/layer-used-p 'lsp) - (lsp) + (progn + ;; without setting lsp-prefer-flymake to :none + ;; golangci-lint errors won't be reported + (when go-use-golangci-lint + (message "[go] Setting lsp-prefer-flymake :none to enable golangci-lint support.") + (setq-local lsp-prefer-flymake :none)) + (lsp)) (message "`lsp' layer is not installed, please add `lsp' layer to your dotfile."))) (defun spacemacs//go-setup-company-lsp ()