go-mode: build and test tools
This commit is contained in:
parent
73a01409c2
commit
2e702b260e
2 changed files with 23 additions and 1 deletions
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"
|
||||
:init
|
||||
(add-hook! go-mode '(emr-initialize flycheck-mode))
|
||||
(build-for! go-mode "go build")
|
||||
:config
|
||||
(bind! :map go-mode-map
|
||||
: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)
|
||||
(let ((command-name (car x))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue