summary refs log tree commit diff
path: root/emacs/custom/my-lang-go.el
blob: c5181fae4e23a55fbdc9cec7e364d7eb7dc091b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;;; my-lang-go.el --- configure emacs for go -*- lexical-binding: t -*-
;; Author: Franck Cuny <franck@fcuny.net>

;;; Commentary:

;;; Code:

(require 'go-mode)
(require 'gotest)
(require 'eglot)

(defun my/go-mode-setup ()
  "Hooks for `go-mode'."
  (setq tab-width 4)
  (setq go-test-verbose t))

(add-hook 'go-mode-hook 'eglot-ensure)
(add-hook 'go-mode-hook #'(lambda() (add-hook 'before-save-hook 'eglot-format-buffer nil t)))
(add-hook 'go-mode-hook #'my/go-mode-setup)

(provide 'my-lang-go)

;;; my-lang-go.el ends here