Skip to content

Instantly share code, notes, and snippets.

@ianschenck
Created July 4, 2014 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianschenck/3b0930ecaa563f09c88e to your computer and use it in GitHub Desktop.
Save ianschenck/3b0930ecaa563f09c88e to your computer and use it in GitHub Desktop.
emacs and go
(defun go-build ()
"Build a go package"
(interactive)
(compile "go build"))
(defun go-test ()
"Test a go packages"
(interactive)
(compile "go test -v"))
(defun go-vet ()
"Vet a go package"
(interactive)
(compile "go vet ./*.go"))
(defun go-mode-keys ()
"Modify go-mode local key map"
(local-set-key (kbd "C-c C-b") 'go-build)
(local-set-key (kbd "C-c C-t") 'go-test)
(local-set-key (kbd "C-c C-v") 'go-vet))
(add-hook 'go-mode-hook 'go-mode-keys)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment