~hristoast/dot-emacs

b9097af6bb8c97cccd60f56471ec35d7cc6aba6d — Hristos N. Triantafillou 3 months ago e241185
Only do that for go-mode
1 files changed, 5 insertions(+), 7 deletions(-)

M lib/golang.el
M lib/golang.el => lib/golang.el +5 -7
@@ 13,13 13,11 @@

(use-package go-mode
  :straight t
  :init
  (defun hristoast-golang-before-save ()
    "Do the right thing whether it's lsp-mode or eglot."
        (progn
          (lsp-format-buffer)
          (lsp-organize-imports)))
  :hook
  (before-save . hristoast-golang-before-save))
  (before-save . (lambda ()
                   (when (eq major-mode 'go-mode)
                     (progn
                       (lsp-format-buffer)
                       (lsp-organize-imports))))))

;;; golang.el ends here