aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/init-go.el
blob: f0a6b847bf58345e65e1b5cc0f9b9e75835083cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
(when (gx/maybe-require-package 'go-mode)
  (add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode)))

(add-hook 'go-mode-hook (lambda () (setq tab-width 4)))

(gx/maybe-require-package 'go-dlv)

(when (gx/maybe-require-package 'eglot)
  (add-hook 'go-mode-hook #'eglot-ensure)
  (add-hook 'go-mode-hook #'gx/eglot-format-before-save)
  (add-hook 'go-mode-hook #'gx/eglot-code-action-organize-imports-before-save))

(provide 'init-go)