mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
go-mode: build and test tools
This commit is contained in:
18
modules/lib/defuns-go.el
Normal file
18
modules/lib/defuns-go.el
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
;;; defuns-go.el
|
||||||
|
|
||||||
|
;; TODO Implement narf:go-get-package
|
||||||
|
(defun narf--go-get-package ())
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun narf:go-test-run-all ()
|
||||||
|
(interactive)
|
||||||
|
(async-shell-command (format "cd '%s' && go test" (narf/project-root))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun narf:go-test-run-package ()
|
||||||
|
(interactive)
|
||||||
|
(error "Not yet implemented")
|
||||||
|
(async-shell-command (format "cd '%s' && go test %s" (narf/project-root) (narf--go-get-package))))
|
||||||
|
|
||||||
|
(provide 'defuns-go)
|
||||||
|
;;; defuns-go.el ends here
|
@ -5,10 +5,14 @@
|
|||||||
:interpreter "go"
|
:interpreter "go"
|
||||||
:init
|
:init
|
||||||
(add-hook! go-mode '(emr-initialize flycheck-mode))
|
(add-hook! go-mode '(emr-initialize flycheck-mode))
|
||||||
|
(build-for! go-mode "go build")
|
||||||
:config
|
:config
|
||||||
(bind! :map go-mode-map
|
(bind! :map go-mode-map
|
||||||
:n "gd" 'godef-jump
|
:n "gd" 'godef-jump
|
||||||
:n "gD" 'godef-describe)
|
:n "gD" 'godef-describe
|
||||||
|
:n "tr" 'narf:go-test-run-all
|
||||||
|
:n "ta" 'narf:go-test-run-all
|
||||||
|
:n "ts" 'narf:go-test-run-package)
|
||||||
|
|
||||||
(mapc (lambda (x)
|
(mapc (lambda (x)
|
||||||
(let ((command-name (car x))
|
(let ((command-name (car x))
|
||||||
|
Reference in New Issue
Block a user