summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-04-29 09:16:42 -0700
committerFranck Cuny <franck@fcuny.net>2022-04-29 09:16:42 -0700
commit5843eda8c9080d45ad32bbac40de1dace837a209 (patch)
tree8cdbee47ca9bece75953684ba57a6c8836c20969 /emacs
parentignore a few more things with recentf (diff)
downloademacs.d-5843eda8c9080d45ad32bbac40de1dace837a209.tar.gz
go: define command for compiling
Diffstat (limited to 'emacs')
-rw-r--r--emacs/custom/my-prog.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/emacs/custom/my-prog.el b/emacs/custom/my-prog.el
index 50b0056..2a0f29a 100644
--- a/emacs/custom/my-prog.el
+++ b/emacs/custom/my-prog.el
@@ -68,8 +68,14 @@
 (defun my/go-mode-hook ()
   "Hooks for `go-mode'."
   (add-hook 'before-save-hook 'gofmt-before-save)
-  (customize-set-variable 'go-test-verbose t)
   (setq tab-width 4)
+
+  (set (make-local-variable 'compile-command)
+       "go build -v && go test -v -cover")
+  (define-key go-mode-map (kbd "C-c C-r") 'compile)
+  (define-key go-mode-map (kbd "C-c C-R") 'recompile)
+
+  (customize-set-variable 'go-test-verbose t)
   (define-key go-mode-map (kbd "C-c C-n") 'go-run)
   (define-key go-mode-map (kbd "C-c C-c") 'go-coverage)
   (define-key go-mode-map (kbd "C-c .") 'go-test-current-test)