summaryrefslogtreecommitdiff
path: root/emacs/custom/my-lang-go.el
blob: 7dde8c4bbb593f5c6cb2930ae431f52f09baa015 (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
24
25
;;; 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)

(add-hook 'go-mode-hook 'eglot-ensure)

(add-hook 'go-mode-hook
          (lambda ()
            (setq tab-width 4)
            (setq compile-command "go build -v && go test -v && go vet")))

(add-hook 'go-mode-hook
          (lambda()
            (add-hook 'before-save-hook 'eglot-format-buffer nil t)))

(provide 'my-lang-go)

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