go layer : function to 'go run' on current 'main' package

This commit is contained in:
sectorzero 2015-10-22 12:22:26 -07:00 committed by syl20bnr
parent ecf35c25e6
commit 5c0bbd1660
2 changed files with 8 additions and 0 deletions

View file

@ -67,6 +67,7 @@ formatter, set the value of =gofmt-command=, e.g.
| ~SPC m e b~ | go-play buffer |
| ~SPC m e r~ | go-play region |
| ~SPC m e d~ | download go-play snippet |
| ~SPC m x x~ | run "go run" for the current 'main' package |
| ~SPC m t p~ | run "go test" for the current package |
| ~SPC m g a~ | jump to matching test file or back from test to code file |
| ~SPC m g g~ | go jump to definition |

View file

@ -25,6 +25,12 @@
(interactive)
(shell-command "go test"))
(defun spacemacs/go-run-main ()
(interactive)
(shell-command
(format "go run %s"
(shell-quote-argument (buffer-file-name)))))
(evil-leader/set-key-for-mode 'go-mode
"mhh" 'godoc-at-point
"mig" 'go-goto-imports
@ -33,6 +39,7 @@
"meb" 'go-play-buffer
"mer" 'go-play-region
"med" 'go-download-play
"mxx" 'spacemacs/go-run-main
"mga" 'ff-find-other-file
"mgg" 'godef-jump
"mtp" 'spacemacs/go-run-package-tests))))