From 549001a43bd12a4354c8917bc12056434c9d2b0e Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 27 Mar 2023 19:27:49 -0700 Subject: go: fix the configuration Change-Id: I2e801c7221f37874380d36d883d77c2b9676913c --- emacs/custom/my-lang-go.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/emacs/custom/my-lang-go.el b/emacs/custom/my-lang-go.el index c5181fa..7dde8c4 100644 --- a/emacs/custom/my-lang-go.el +++ b/emacs/custom/my-lang-go.el @@ -9,14 +9,16 @@ (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) + +(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) -- cgit 1.4.1