lang/go: group flycheck config & use add-hook

This commit is contained in:
Henrik Lissner 2018-05-26 10:33:55 +02:00 committed by GitHub
parent e51e483c86
commit 67eb749d1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,11 +15,11 @@
(when-let* ((goimports (executable-find "goimports")))
(setq gofmt-command goimports))
(when (featurep! :feature syntax-checker)
(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))
(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))