aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/rul-init.d/go-lang.el
blob: 8ec678bdd3fc8297c8fd7b98e29f7ffb3d4c2d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;; Debian packages: elpa-go-mode
;; Elpa packages: go-eldoc

(use-package go-mode
  :ensure t
  :init
  (progn
    (bind-key [remap find-tag] #'godef-jump))
  :config
  (add-hook 'go-mode-hook #'yas-minor-mode)
  (add-hook 'go-mode-hook 'electric-pair-mode)
  (add-hook 'go-mode-hook 'my-go-mode-hook)
  (add-hook 'before-save-hook 'gofmt-before-save)
)

(use-package go-eldoc
  :ensure t
  :init
  (add-hook 'go-mode-hook 'go-eldoc-setup))

;; Define function to call when go-mode loads
(defun my-go-mode-hook ()
  (set 'compile-command "go build -v && go test -v && go vet"))
nihil fit ex nihilo