From e51e483c86f100130c7e504325ed8c8e66b46d21 Mon Sep 17 00:00:00 2001 From: Sean Dawson Date: Fri, 25 May 2018 21:17:13 -0400 Subject: [PATCH 1/2] Small fixes for go-mode: - Fixed typo for gocode command in `doctor.el` - Only enable flycheck mode if the syntax-checker feature is enabled --- modules/lang/go/config.el | 4 +++- modules/lang/go/doctor.el | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/lang/go/config.el b/modules/lang/go/config.el index f8e8c6050..88d1da442 100644 --- a/modules/lang/go/config.el +++ b/modules/lang/go/config.el @@ -16,8 +16,10 @@ (setq gofmt-command goimports)) (setq gofmt-show-errors nil) ; Leave it to flycheck + (if (featurep! :feature syntax-checker) + (add-hook! 'go-mode-hook #'flycheck-mode)) - (add-hook! 'go-mode-hook #'(flycheck-mode go-eldoc-setup)) + (add-hook! 'go-mode-hook #'go-eldoc-setup) (add-hook! go-mode (add-hook 'before-save-hook #'gofmt-before-save nil t)) diff --git a/modules/lang/go/doctor.el b/modules/lang/go/doctor.el index cf47a544d..512780ba6 100644 --- a/modules/lang/go/doctor.el +++ b/modules/lang/go/doctor.el @@ -9,5 +9,5 @@ (when (featurep! :completion company) (require 'company-go) - (unless (executable-find command-go-gocode-command) + (unless (executable-find company-go-gocode-command) (warn! "Couldn't find gocode. Code completion won't work"))) From 67eb749d1ecae079f8bd06c8bd5d394d04c4edbd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 26 May 2018 10:33:55 +0200 Subject: [PATCH 2/2] lang/go: group flycheck config & use add-hook --- modules/lang/go/config.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/lang/go/config.el b/modules/lang/go/config.el index 88d1da442..1089d5905 100644 --- a/modules/lang/go/config.el +++ b/modules/lang/go/config.el @@ -15,11 +15,11 @@ (when-let* ((goimports (executable-find "goimports"))) (setq gofmt-command goimports)) - (setq gofmt-show-errors nil) ; Leave it to flycheck - (if (featurep! :feature syntax-checker) - (add-hook! 'go-mode-hook #'flycheck-mode)) + (when (featurep! :feature syntax-checker) + (setq gofmt-show-errors nil) ; Leave it to flycheck + (add-hook 'go-mode-hook #'flycheck-mode)) - (add-hook! 'go-mode-hook #'go-eldoc-setup) + (add-hook 'go-mode-hook #'go-eldoc-setup) (add-hook! go-mode (add-hook 'before-save-hook #'gofmt-before-save nil t))