aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/init-go.el
blob: 3a224fbe76ef57a205e5dd507b9fb57ffad289e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(when (gx/maybe-require-package 'go-mode)
  (autoload #'go-mode "go-mode" nil t)
  (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 #'gx/eglot-format-before-save)
  (add-hook 'go-mode-hook #'gx/eglot-code-action-organize-imports-before-save)
  (add-hook 'go-mode-hook #'eglot-ensure))

(provide 'init-go)