[emacs] Updates go-compile-commande

This commit is contained in:
2023-11-20 13:57:17 +01:00
parent 1d0c8b75a3
commit 44f4ee000f

8
.emacs
View File

@@ -906,17 +906,19 @@
:after (projectile) :after (projectile)
:config :config
(unbind-key "C-c C-d" go-mode-map) (unbind-key "C-c C-d" go-mode-map)
(defun go-compile-command () (defun atu/go-compile-command ()
"returns a string to compile a go project" "returns a string to compile a go project"
(setq project-makefile (concat (file-name-as-directory (projectile-project-root)) "Makefile")) (interactive)
(let ((project-makefile (concat (file-name-as-directory (projectile-project-root)) "Makefile")))
(if (file-exists-p project-makefile) (if (file-exists-p project-makefile)
"make" "make"
"go build && go test && go vet" "go build && go test && go vet"
) )
) )
)
(projectile-update-project-type (projectile-update-project-type
'go 'go
:compile 'go-compile-command) :compile 'atu/go-compile-command)
:hook :hook
(go-mode . lsp-deferred) (go-mode . lsp-deferred)
(go-mode . (lambda () (go-mode . (lambda ()